CMake: Use CMAKE_C_FLAGS instead of add_compile_options

This is for compatibility reasons with old CMake 2.8 versions.
This commit is contained in:
Max Bruckner 2016-11-07 00:08:20 +07:00
parent 966646d70e
commit 5838e279a5

View File

@ -12,7 +12,7 @@ set(CJSON_UTILS_VERSION_SO 1)
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
if(("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")) if(("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang"))
add_compile_options(-ansi -pedantic -Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -pedantic -Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings")
endif() endif()
#variables for pkg-config #variables for pkg-config