aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthias Kretz <kretz@kde.org>2007-01-23 11:05:14 +0000
committerMatthias Kretz <kretz@kde.org>2007-01-23 11:05:14 +0000
commite1efbf5c80ca2407c6e94ab1f6263f9cadbed86e (patch)
tree434d3094f2d3afda5b899f86a99830a70ee82c99 /modules
parentc26c332ac1b79311e0afc242d405dbb444520672 (diff)
downloadextra-cmake-modules-e1efbf5c80ca2407c6e94ab1f6263f9cadbed86e.tar.gz
extra-cmake-modules-e1efbf5c80ca2407c6e94ab1f6263f9cadbed86e.tar.bz2
add -fno-threadsafe-statics to the CXXFLAGS if supported: as we can't rely on
threadsafe local statics anyway, we can save the cycles in gcc4 compiled programs (gcc4 adds a mutex around every local static). svn path=/trunk/KDE/kdelibs/; revision=626443
Diffstat (limited to 'modules')
-rw-r--r--modules/FindKDE4Internal.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake
index a1ad01b9..84f4f1b9 100644
--- a/modules/FindKDE4Internal.cmake
+++ b/modules/FindKDE4Internal.cmake
@@ -713,6 +713,12 @@ if (CMAKE_COMPILER_IS_GNUCXX)
MESSAGE(STATUS "Your compiler doesn't support PIE flag")
endif(HAVE_FPIE_SUPPORT)
endif(KDE4_ENABLE_FPIE)
+ # save a little by making local statics not threadsafe
+ check_cxx_compiler_flag(-fno-threadsafe-statics __KDE_HAVE_NO_THREADSAFE_STATICS)
+ if (__KDE_HAVE_NO_THREADSAFE_STATICS)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics")
+ endif (__KDE_HAVE_NO_THREADSAFE_STATICS)
+
# visibility support
check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY)