diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-10-26 16:00:29 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-10-26 16:02:07 +0300 |
commit | 41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd (patch) | |
tree | b29207e44aa8dcc10ef2deb51ac1514fb934c420 /CMakeLists.txt | |
parent | a6b2b4b2a4095d2f95419df986378e54432c2d71 (diff) | |
download | ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.gz ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.tar.bz2 ck-41ae1a0f0d86d2fc19f333ee23889c11beb0a4dd.zip |
Confort to pedantic std-c99 and update readme
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3808c3c..c5c5620 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,21 +14,20 @@ project(ck C) set(ck_MAJOR_VERSION 0) set(ck_MINOR_VERSION 7) -# c flags -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +# Feature test macros +set(FEATURE_TEST_MACROS "-D_DEFAULT_SOURCE") +# Default C flags +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FEATURE_TEST_MACROS} -std=c99 -pedantic") +# Warnings for debug builds +set(C_WARNINGS "-Wall -Wextra -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith") # options -option(CK_ASAN "Build with asan") -option(CK_DEBUG "Build with debug symbols") +option(CK_DEBUG "Build with debug symbols, asan and warnings") option(CK_TESTS "Make the tests") option(CK_SHARED "Build with shared lib") -if(CK_ASAN) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") -endif() - if (CK_DEBUG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_WARNINGS} -g3 -fsanitize=address") else(CK_DEBUG) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") endif() |