diff options
author | Milian Wolff <mail@milianw.de> | 2013-07-24 21:43:05 +0200 |
---|---|---|
committer | Milian Wolff <mail@milianw.de> | 2013-07-24 21:43:05 +0200 |
commit | 5491963843c633e3b9121c1eabbc1cbf9a45d7fc (patch) | |
tree | 42421e6635d507d594f9361f979282ee0a4937d3 | |
parent | 13cc2f944e9ee5621e22f5f66181b262450d1224 (diff) | |
download | extra-cmake-modules-5491963843c633e3b9121c1eabbc1cbf9a45d7fc.tar.gz extra-cmake-modules-5491963843c633e3b9121c1eabbc1cbf9a45d7fc.tar.bz2 |
Add Clang support to KDECompilerSettings.cmake
This more or less copies what was done for KDE4 in
https://git.reviewboard.kde.org/r/111612/.
With the changes applied I successfully installed a hello world
application. The linker and compiler command lines seem to be correct
and include all extended features. I also checked and debugfull also
works as expected (-g3 is added).
REVIEW: 111661
-rw-r--r-- | kde-modules/KDECompilerSettings.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake index d72bd9e6..4a9f760b 100644 --- a/kde-modules/KDECompilerSettings.cmake +++ b/kde-modules/KDECompilerSettings.cmake @@ -149,10 +149,9 @@ if (APPLE) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common") endif (APPLE) - # TODO: why don't we go inside that block on the BSDs ? if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # TODO: does the Intel compiler also support --enable-new-dtags ? ...probably since they are only forwarded to the linker.... set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--enable-new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}") @@ -233,6 +232,10 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES # ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs}) +endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # TODO: why do the other KDE4_ENABLE_EXCEPTIONS not have -UQT_NO_EXCEPTIONS ? set (KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS") # Select flags. @@ -288,7 +291,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") endif() endif() -endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") |