summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3cc37e..41fedb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,12 +3,17 @@ include(CheckFunctionExists)
include(CheckSymbolExists)
project(ucode C)
-add_definitions(-Os -Wall -Werror --std=gnu99 -ffunction-sections -fwrapv -D_GNU_SOURCE -D_FORTIFY_SOURCE=2)
+add_definitions(-Os -Wall -Werror --std=gnu99 -ffunction-sections -fwrapv -D_GNU_SOURCE)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
add_definitions(-Wextra -Werror=implicit-function-declaration)
add_definitions(-Wformat -Werror=format-security -Werror=format-nonliteral)
endif()
+
+if(NOT CMAKE_C_FLAGS MATCHES -D_FORTIFY_SOURCE=)
+ add_definitions(-D_FORTIFY_SOURCE=2)
+endif()
+
add_definitions(-Wmissing-declarations -Wno-error=unused-variable -Wno-unused-parameter)
include_directories(include)