diff options
author | Allen Winter <winter@kde.org> | 2006-05-13 03:02:56 +0000 |
---|---|---|
committer | Allen Winter <winter@kde.org> | 2006-05-13 03:02:56 +0000 |
commit | b8e571ba8a53bc1c6f63e06deaa1f1db16b2fcb7 (patch) | |
tree | add4214bb63042c9e763726aa6dea1c6b64ec79d | |
parent | cf37d2b2f602910dbd5ad7bf3e4532e90a009840 (diff) | |
download | extra-cmake-modules-b8e571ba8a53bc1c6f63e06deaa1f1db16b2fcb7.tar.gz extra-cmake-modules-b8e571ba8a53bc1c6f63e06deaa1f1db16b2fcb7.tar.bz2 |
First attempt at support for the Intel C/C++ compilers.
Still to-do:
- shared and module linker flags
- visibility support
- shutup lots of harmless, annoying remarks
To play with this:
- install Intel C/C++ compilers.
- set $PATH and $LD_LIBRARY_PATH correctly for the new stuff
- export CC=icc; export CXX=icpc
- mkdir kdelibs/build-icpc
- cd kdelibs/build-icpc
- cmake ..
svn path=/trunk/KDE/kdelibs/; revision=540332
-rw-r--r-- | modules/FindKDE4Internal.cmake | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index 418541df..4a22d1c2 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -547,9 +547,18 @@ endif (APPLE) if (CMAKE_SYSTEM_NAME MATCHES Linux) - set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE) - set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc") - set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc") + 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 -avoid-version -Wl,--no-undefined -lc") + set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc") + endif (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_C_COMPILER MATCHES "icc") + set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE) +# set ( CMAKE_SHARED_LINKER_FLAGS "-Qoption,ld,--fatal-warnings -avoid-version --no-undefined -lc") +# set ( CMAKE_MODULE_LINKER_FLAGS "-Qoption,ld,--fatal-warnings -avoid-version --no-undefined -lc") + set ( CMAKE_SHARED_LINKER_FLAGS "") + set ( CMAKE_MODULE_LINKER_FLAGS "") + endif (CMAKE_C_COMPILER MATCHES "icc") endif (CMAKE_SYSTEM_NAME MATCHES Linux) if (CMAKE_SYSTEM_NAME MATCHES BSD) @@ -589,6 +598,31 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_C_COMPILER MATCHES "icc") + set (KDE4_ENABLE_EXCEPTIONS -fexceptions) + # Select flags. + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_CXX_FLAGS_RELEASE "-O2") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") + set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_C_FLAGS_RELEASE "-O2") + set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") + set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline") + + if (CMAKE_SYSTEM_NAME MATCHES Linux) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -Wall -Wpointer-arith") + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -Wall -Wpointer-arith -fno-exceptions") + endif (CMAKE_SYSTEM_NAME MATCHES Linux) + + # visibility support +# check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY) +# if (__KDE_HAVE_GCC_VISIBILITY) +# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +# endif (__KDE_HAVE_GCC_VISIBILITY) + +endif (CMAKE_C_COMPILER MATCHES "icc") + # it seems we prefer not to use a different postfix for debug libs, Alex # SET(CMAKE_DEBUG_POSTFIX "_debug") |