From 5318ddaabc9d3a9497b7c76e6260b55457fa5f2d Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Sat, 10 Aug 2024 01:49:10 +0200 Subject: [PATCH] Use CMake's `C_STANDARD` property This is more portable than specifying a compiler flag explicitly. Signed-off-by: James Wrigley Reviewed-by: Jakub Jelen (cherry picked from commit 7e4ea0d1116c1d91b63398a6f3c65fa6903abbdf) --- CompilerChecks.cmake | 1 - src/CMakeLists.txt | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake index 7a25b592..81fb5462 100644 --- a/CompilerChecks.cmake +++ b/CompilerChecks.cmake @@ -16,7 +16,6 @@ if (UNIX) endif() endif() - add_c_compiler_flag("-std=gnu99" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wpedantic" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wall" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wshadow" SUPPORTED_COMPILER_FLAGS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93ecb5e7..199acbd9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -355,6 +355,8 @@ endif (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT) set_target_properties(ssh PROPERTIES + C_STANDARD + 99 VERSION ${LIBRARY_VERSION} SOVERSION