Make/CMake: Fix use of compiler flags

CMake: Option was not enabled by default as intended.
Makefile: Flags were not passed when building the tests
This commit is contained in:
Max Bruckner committed 2016-11-26 22:09:20 +07:00
1 parent d0a9f46888
commit 4703f01cf4
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ set(CJSON_VERSION_SO 1)
set(CJSON_UTILS_VERSION_SO 1)
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
option(ENABLE_CUSTOM_COMPILER_FLAGS ON)
option(ENABLE_CUSTOM_COMPILER_FLAGS "Enables custom compiler flags for Clang and GCC" ON)
if (ENABLE_CUSTOM_COMPILER_FLAGS)
if(("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang"))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -pedantic -Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings")