From 0f91738f9931d9c495f2d1da3e48f1312cc16337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Mon, 16 Nov 2026 19:25:22 +0100 Subject: [PATCH] CMake: compile GKlib's own sources as C11 The public headers in include/ are unchanged and remain C99-compatible, so METIS, ParMETIS and other consumers can still include them without a C11 compiler. --- CMakeLists.txt | 2 ++ README.md | 1 + apps/CMakeLists.txt | 3 +++ 3 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed8deb1..34e44e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,8 @@ target_link_libraries(${PROJECT_NAME} PUBLIC $<$>:m>) set_target_properties(${PROJECT_NAME} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON POSITION_INDEPENDENT_CODE ON SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION}) diff --git a/README.md b/README.md index 5e9e037..48f0e73 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ A library of various helper routines and frameworks used by many of the lab's software ## Build requirements + - C compiler, C11 compliant - CMake 3.10, found at http://www.cmake.org/, as well as GNU make. Assuming that the above are available, two commands should suffice to diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 6c47641..2432f77 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -5,6 +5,9 @@ set(GKLIB_PROGRAMS strings gksort fis gkrw gkgraph csrcnv grKx m2mnbrs cmpnbrs foreach(prog ${GKLIB_PROGRAMS}) add_executable(${prog} ${prog}.c) target_link_libraries(${prog} GKlib::GKlib) + set_target_properties(${prog} PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED ON) endforeach() # install executables