From b8e571ba8a53bc1c6f63e06deaa1f1db16b2fcb7 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sat, 13 May 2006 03:02:56 +0000 Subject: 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 --- modules/FindKDE4Internal.cmake | 40 +++++++++++++++++++++++++++++++++++++--- 1 file 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") -- cgit v1.2.1