diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fcc99243..4f49c770 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,6 +20,18 @@ set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" "${GLFW_SOURCE_DIR}/deps/tinycthread.c") +if (${CMAKE_VERSION} VERSION_EQUAL "3.1.0" OR + ${CMAKE_VERSION} VERSION_GREATER "3.1.0") + set(CMAKE_C_STANDARD 99) +else() + # Remove this fallback when removing support for CMake version less than 3.1 + add_compile_options( + "$<$:-std=c99>" + "$<$:-std=c99>" + "$<$:-std=c99>") + +endif() + add_executable(clipboard clipboard.c ${GETOPT} ${GLAD_GL}) add_executable(events events.c ${GETOPT} ${GLAD_GL}) add_executable(msaa msaa.c ${GETOPT} ${GLAD_GL})