From 6a5afb18a0411ff6228fe9311b0817949aefc825 Mon Sep 17 00:00:00 2001 From: CPunch Date: Mon, 14 Mar 2022 01:11:13 -0500 Subject: [PATCH] CMake: Require C11 for each target --- bot/CMakeLists.txt | 1 + cnc/CMakeLists.txt | 1 + lib/CMakeLists.txt | 1 + shell/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/bot/CMakeLists.txt b/bot/CMakeLists.txt index dbfe792..9424f51 100644 --- a/bot/CMakeLists.txt +++ b/bot/CMakeLists.txt @@ -11,6 +11,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) file(GLOB_RECURSE BOTSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c) file(GLOB_RECURSE BOTHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h) add_executable(LaikaBot ${BOTSOURCE} ${BOTHEADERS}) +set_property(TARGET LaikaBot PROPERTY C_STANDARD 11) target_link_libraries(LaikaBot PUBLIC LaikaLib util) # add the 'DEBUG' preprocessor definition if we're compiling as Debug diff --git a/cnc/CMakeLists.txt b/cnc/CMakeLists.txt index 12b11e8..d07c4ba 100644 --- a/cnc/CMakeLists.txt +++ b/cnc/CMakeLists.txt @@ -11,6 +11,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) file(GLOB_RECURSE CNCSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c) file(GLOB_RECURSE CNCHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h) add_executable(LaikaCNC ${CNCSOURCE} ${CNCHEADERS}) +set_property(TARGET LaikaCNC PROPERTY C_STANDARD 11) target_link_libraries(LaikaCNC PUBLIC LaikaLib) # add the 'DEBUG' preprocessor definition if we're compiling as Debug diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index a5bc6e8..7a11d13 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -31,6 +31,7 @@ add_subdirectory(libsodium) file(GLOB_RECURSE LIBSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c ${CMAKE_CURRENT_SOURCE_DIR}/vendor/**.c) file(GLOB_RECURSE LIBHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h) add_library(LaikaLib STATIC ${LIBSOURCE} ${LIBHEADERS}) +set_property(TARGET LaikaLib PROPERTY C_STANDARD 11) target_link_libraries(LaikaLib PRIVATE sodium) # add the version definitions and the 'DEBUG' preprocessor definition if we're compiling as Debug diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index e3b2300..90ec586 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -11,6 +11,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) file(GLOB_RECURSE SHELLSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c) file(GLOB_RECURSE SHELLHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h) add_executable(LaikaShell ${SHELLSOURCE} ${SHELLHEADERS}) +set_property(TARGET LaikaShell PROPERTY C_STANDARD 11) target_link_libraries(LaikaShell PUBLIC LaikaLib) # add the 'DEBUG' preprocessor definition if we're compiling as Debug