[PATCH 1/3] Pass additional gcc compiler flags regardless of the OS.
Raphael Kubo da Costa
rakuco at FreeBSD.org
Mon Jul 23 13:38:03 UTC 2012
Building picmi on FreeBSD was failing because of -Wlong-long, which
should have been disabled by default via _KDE4_PLATFORM_DEFINITIONS.
However, commit 4e0bbaee43ecf3fe8c880212da8ad6ca96978c2a made the
additional gcc flags be passed only when building on Linux (commit
9986ec68bbbd55a0b7ad589752a0ed0d03ece639 extended that to GNU Hurd)
for no apparent reason.
Thus sort of restore the behavior present in commit
4d1789f40ed1cc6e34e55b9edc119ee6389e1368, with the difference that the
flags are passed even on Windows and other systems.
---
cmake/modules/FindKDE4Internal.cmake | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake
index 916c9c2..0a1a3e8 100644
--- a/cmake/modules/FindKDE4Internal.cmake
+++ b/cmake/modules/FindKDE4Internal.cmake
@@ -1211,12 +1211,13 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
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 -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common")
add_definitions (-D_BSD_SOURCE)
endif (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 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 -ansi -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")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
--
1.7.11.2
More information about the Kde-buildsystem
mailing list