diff options
author | Laurent Montel <montel@kde.org> | 2006-08-16 15:02:59 +0000 |
---|---|---|
committer | Laurent Montel <montel@kde.org> | 2006-08-16 15:02:59 +0000 |
commit | a2e1d1600fd23be9974d4ff99c438aae6d134a2b (patch) | |
tree | cafd3ae7980e732827c160460cdf5fc38e6d0d96 /modules | |
parent | 787e9f69caaecbf91e28578452659f7d4ad15cbd (diff) | |
download | extra-cmake-modules-a2e1d1600fd23be9974d4ff99c438aae6d134a2b.tar.gz extra-cmake-modules-a2e1d1600fd23be9974d4ff99c438aae6d134a2b.tar.bz2 |
Add support for -FPIE
I don't know if other compiler supports it.
For the moment I just add it for gcc
svn path=/trunk/KDE/kdelibs/; revision=573536
Diffstat (limited to 'modules')
-rw-r--r-- | modules/FindKDE4Internal.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index d7e34417..eb0d104e 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -239,6 +239,7 @@ get_filename_component( kde_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH) option(KDE4_ENABLE_FINAL "Enable final all-in-one compilation") option(KDE4_BUILD_TESTS "Build the tests") +option(KDE4_ENABLE_FPIE "Enable platform supports PIE linking") #now try to find some kde stuff @@ -595,6 +596,16 @@ if (CMAKE_COMPILER_IS_GNUCXX) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common") endif (CMAKE_SYSTEM_NAME MATCHES Linux) + + check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT) + if(KDE4_ENABLE_FPIE) + if(HAVE_FPIE_SUPPORT) + set (KDE4_CXX_FPIE_FLAGS "-fPIE") + set (KDE4_PIE_LDFLAGS "-pie") + else(HAVE_FPIE_SUPPORT) + MESSAGE(STATUS "Your compiler doesn't support PIE flag") + endif(HAVE_FPIE_SUPPORT) + endif(KDE4_ENABLE_FPIE) # visibility support check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY) |