From f7433e0366ab3ecaa989c2d3ac549449c13ec8cc Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 30 Oct 2020 12:44:16 +0100 Subject: [BUILD] do not ignore C flags that are passed to CMake C flags which are set by the environment variable CFLAGS have been ignored by CMake since the corresponding CMake variable CMAKE_C_FLAGS was not extended with those passed flags, but have been overwritten by a fixed set of flags. This patch fixes the overwrite of CMAKE_C_FLAGS and extends its content with the C flags passed in the environment variable. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a9eda5..42f259c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ gen_build_type(${INCLUDE_BUILD_HEADER_TEMPLATE} ${INCLUDE_BUILD_HEADER_GENERATE} add_definitions(-D_FILE_OFFSET_BITS=64) # define global C flags for compilation -set(CMAKE_C_FLAGS "-std=c11") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") # enable all error warnings in Debug build configuration set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -Wpedantic -Wconversion -Wformat -Wformat-security -Werror=format-security") -- cgit v1.2.3-55-g7522