[extra-cmake-modules] kde-modules: Enable the additional GCC compiler flags on all systems.

Raphael Kubo da Costa rakuco at FreeBSD.org
Fri Aug 17 10:18:22 UTC 2012


Git commit 9d5fdf0e88183acf04df225b654e3d77105b80b6 by Raphael Kubo da Costa.
Committed on 17/08/2012 at 12:15.
Pushed by rkcosta into branch 'master'.

Enable the additional GCC compiler flags on all systems.

There was no reason to add more flags only on Linux/Hurd; in fact, in
kdelibs' FindKDE4Internal.cmake there's also a block with similar
settings for the BSDs.

Make it more general by removing the system checks before setting
these flags. -Wno-long-long is particularly needed when one is
building code with -pedantic (see picmi, for example).

CCMAIL: kde-buildsystem at kde.org

M  +3    -9    kde-modules/KDECompilerSettings.cmake

http://commits.kde.org/extra-cmake-modules/9d5fdf0e88183acf04df225b654e3d77105b80b6

diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake
index 12bd1e3..ac21cf7 100644
--- a/kde-modules/KDECompilerSettings.cmake
+++ b/kde-modules/KDECompilerSettings.cmake
@@ -321,15 +321,9 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    set (CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
    set (CMAKE_MODULE_LINKER_FLAGS_PROFILE "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
 
-
-   if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
-     set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
-     # As off Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions
-     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common")
-# TODO: the following line was added by Dirk in 2007 to make snprintf() available. But this should not be necessary, since
-#       _BSD_SOURCE is already added to _KDE4_PLATFORM_DEFINITIONS (http://quickgit.kde.org/index.php?p=kdelibs.git&a=commitdiff&h=4a44862b2d178c1d2e1eb4da90010d19a1e4a42c&hp=6531561cb4ed978ff86b8d840dcafc9705af5527)
-#     add_definitions (-D_BSD_SOURCE)
-   endif ()
+   set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+   # As of Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common")
 
    if (CMAKE_SYSTEM_NAME STREQUAL GNU)
       set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")


More information about the Kde-buildsystem mailing list