include_directories(${OPENSSL_INCLUDE_DIR})
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
- add_compile_options(-O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb -Qunused-arguments -Wno-deprecated-declarations)
+ set(CMAKE_C_FLAGS_RELEASE -O2)
+ set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb")
+ add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Qunused-arguments -Wno-deprecated-declarations)
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU")
- add_compile_options(-O2 -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -ggdb -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-deprecated-declarations)
+ set(CMAKE_C_FLAGS_RELEASE -O2)
+ set(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb")
+ add_compile_options(-Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-error=unknown-pragmas -Wno-error=pragmas -Wno-deprecated-declarations)
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
- add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS)
- add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
- add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ add_definitions(-D_CRT_DEPRECATED_NO_WARNINGS)
+ add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
+ add_compile_options(/MP /WX /W4 /wd4100 /wd4267 /wd4206 /wd4706 /wd4244 /wd4115)
endif()
if (ASAN)