From ce834cda462d0f18d4ce1a605f98e9e9300d9dd9 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Mon, 22 Nov 2010 14:57:19 +0100 Subject: [PATCH] Add seperate compiler flags for C++ and C files. --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f250b397d..b125c56e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,15 @@ option(WITH_TESTS "Enable building of unit tests" ON) set( KEEPASSX_VERSION "0.9.0" ) if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-DQT_NO_KEYWORDS -DQT_NO_EXCEPTIONS -DQT_NO_STL -fno-exceptions -fno-rtti - -ansi -Wall -Wextra -Wundef -Wold-style-cast -Wnon-virtual-dtor -Wcast-align - -Wpointer-arith -Wformat-security -Woverloaded-virtual -Wno-long-long) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -fno-common -fno-exceptions -fno-rtti") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_KEYWORDS -DQT_NO_EXCEPTIONS -DQT_NO_STL") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wold-style-cast -Wnon-virtual-dtor -Wcast-align") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith -Wformat-security -Woverloaded-virtual -Wno-long-long") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -fno-common") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wcast-align -Wchar-subscripts -Wpointer-arith") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wwrite-strings -Wformat-security -Werror-implicit-function-declaration") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -Wno-long-long") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed -Wl,--no-undefined") endif(CMAKE_COMPILER_IS_GNUCXX)