summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-09 01:11:38 -0600
committerSlávek Banko <slavek.banko@axis.cz>2015-12-23 02:22:26 +0100
commit05b2e1bc9c15f5f17d3e83fd9a5e33cf52ef3ad3 (patch)
treeeb6d2c86664d1fb4b4a8e53f3cdb0111017c61a5
parentd3a4952cc16a43758fc9b1d1f8039da21090023f (diff)
downloadtdelibs-05b2e1bc9c15f5f17d3e83fd9a5e33cf52ef3ad3.tar.gz
tdelibs-05b2e1bc9c15f5f17d3e83fd9a5e33cf52ef3ad3.zip
Add gcc visibility option to tdelibs
(cherry picked from commit 7508eafbec2436de2d49d4e93d8f4030ec48aa1f)
-rw-r--r--CMakeLists.txt16
-rw-r--r--config.h.cmake3
2 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 428ad4fac..c735bc335 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,7 @@ OPTION( WITH_OPENEXR "Enable openexr support" ${WITH_ALL_OPTIONS} )
OPTION( WITH_UTEMPTER "Use utempter for utmp management" ${WITH_ALL_OPTIONS} )
OPTION( WITH_AVAHI "Enable AVAHI support" ${WITH_ALL_OPTIONS} )
OPTION( WITH_PCRE "Enable pcre regex support for kjs" ON )
+OPTION( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" OFF )
OPTION( WITH_INOTIFY "Enable inotify support for kio" ON )
OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} )
OPTION( WITH_SUDO_KDESU_BACKEND "Use sudo as backend for kdesu (default is su)" OFF )
@@ -766,6 +767,21 @@ if( WITH_PCRE )
set( HAVE_PCREPOSIX 1 )
endif( )
+
+##### check for gcc visibility support #########
+# FIXME
+# This should check for [T]Qt3 visibility support
+
+if( WITH_GCC_VISIBILITY )
+ if( NOT UNIX )
+ message(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" )
+ endif( NOT UNIX )
+ set( __KDE_HAVE_GCC_VISIBILITY 1 )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+endif( )
+
+
##### check for inotify ###########################
if( WITH_INOTIFY )
diff --git a/config.h.cmake b/config.h.cmake
index 16e8434f9..8f97d45c3 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -116,6 +116,9 @@
/* Define if you have OpenEXR */
#cmakedefine HAVE_EXR 1
+/* Defined if you have fvisibility and fvisibility-inlines-hidden support. */
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
+
/* Define is posix_fadvise is supported */
#undef HAVE_FADVISE