From: Vladislav Shchapov Date: Tue, 17 Sep 2024 15:10:34 +0000 (+0500) Subject: Fix overridde CMAKE_C_STANDARD, CMAKE_C_STANDARD_REQUIRED, CMAKE_C_EXTENSIONS. False... X-Git-Tag: 2.2.3~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efca01266d0dc03323fb26dbc3f5c6e190cec547;p=thirdparty%2Fzlib-ng.git Fix overridde CMAKE_C_STANDARD, CMAKE_C_STANDARD_REQUIRED, CMAKE_C_EXTENSIONS. False value is allowed for CMAKE_C_STANDARD_REQUIRED and CMAKE_C_EXTENSIONS. Signed-off-by: Vladislav Shchapov --- diff --git a/CMakeLists.txt b/CMakeLists.txt index deb075d1..dca75063 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,13 +9,13 @@ message(STATUS "Using CMake version ${CMAKE_VERSION}") # If not specified on the command line, enable C11 as the default # Configuration items that affect the global compiler environment standards # should be issued before the "project" command. -if(NOT CMAKE_C_STANDARD) +if(NOT DEFINED CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 11) # The C standard whose features are requested to build this target endif() -if(NOT CMAKE_C_STANDARD_REQUIRED) +if(NOT DEFINED CMAKE_C_STANDARD_REQUIRED) set(CMAKE_C_STANDARD_REQUIRED ON) # Boolean describing whether the value of C_STANDARD is a requirement endif() -if(NOT CMAKE_C_EXTENSIONS) +if(NOT DEFINED CMAKE_C_EXTENSIONS) set(CMAKE_C_EXTENSIONS OFF) # Boolean specifying whether compiler specific extensions are requested endif() set(VALID_C_STANDARDS "99" "11")