CMake: Add C_STANDARD_REQUIRED;

When you set C_STANDARD, CMake won't listen and will decay to older
C versions if the one you asked for isn't supported.

You can set C_STANDARD_REQUIRED, but it won't work in VS 2017 and below.

I guess this is better than nothing.
This commit is contained in:
bjorn 2022-04-27 20:31:10 -07:00
parent 24a0751c16
commit 005530c9c0
1 changed files with 1 additions and 0 deletions

View File

@ -323,6 +323,7 @@ endif()
set_target_properties(lovr PROPERTIES C_VISIBILITY_PRESET ${LOVR_SYMBOL_VISIBILITY})
set_target_properties(lovr PROPERTIES C_STANDARD 11)
set_target_properties(lovr PROPERTIES C_STANDARD_REQUIRED ON)
target_include_directories(lovr PRIVATE src src/modules src/lib/stdatomic etc)
target_link_libraries(lovr
${LOVR_GLFW}