aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2009-12-03 23:34:11 +0000
committerPino Toscano <pino@kde.org>2009-12-03 23:34:11 +0000
commit666608af55e914cbf0ab3b4af51a4bc79ba831b3 (patch)
tree7cb56f213313e2ed0a893a023c4dba8102ffe839
parentf11f354de9484949ff5567f344b38207d67fcd46 (diff)
downloadextra-cmake-modules-666608af55e914cbf0ab3b4af51a4bc79ba831b3.tar.gz
extra-cmake-modules-666608af55e914cbf0ab3b4af51a4bc79ba831b3.tar.bz2
add support for the GNU OS (also known as Hurd)
- it mostly behaves as linux, as the toolchain (gcc, gnu ld, gnu libc) is the same - add -pthread to the ld flags for shared modules and libraries svn path=/trunk/KDE/kdelibs/; revision=1058116
-rw-r--r--modules/FindKDE4Internal.cmake13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake
index 710a8af9..41204bf4 100644
--- a/modules/FindKDE4Internal.cmake
+++ b/modules/FindKDE4Internal.cmake
@@ -985,7 +985,7 @@ if (APPLE)
endif (APPLE)
-if (CMAKE_SYSTEM_NAME MATCHES Linux)
+if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
if (CMAKE_COMPILER_IS_GNUCXX)
set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE)
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -1006,7 +1006,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Linux)
set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
endif (CMAKE_C_COMPILER MATCHES "icc")
-endif (CMAKE_SYSTEM_NAME MATCHES Linux)
+endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
if (UNIX)
set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_LARGEFILE64_SOURCE")
@@ -1075,12 +1075,17 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline")
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
- if (CMAKE_SYSTEM_NAME MATCHES Linux)
+ 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)
+ endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+
+ 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")
+ endif (CMAKE_SYSTEM_NAME STREQUAL GNU)
# gcc under Windows
if (MINGW)