explicitly skipping visibility check

Ariya Hidayat ariya at kde.org
Wed May 9 12:13:32 BST 2007


Tell me if this is completely wrong.

I was trying to build strigi (+kdelibs) and hit by "unknown reference"
errors. I suspect it's about gcc's visibility. Perhaps I'm on
compiler/distro combination for which the visibility support is
broken, and it was not detected by the cmake macro.

The following patch makes it easy to disable gcc visibility check,
just by putting -DSKIP_VISIBILITY_CHECK in the cmakekde function. It
has minimal impact when doing everything as usual.


Index: MacroCheckGccVisibility.cmake
===================================================================
--- MacroCheckGccVisibility.cmake       (revision 662842)
+++ MacroCheckGccVisibility.cmake       (working copy)
@@ -6,6 +6,9 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 macro(MACRO_CHECK_GCC_VISIBILITY GccVisibility)
+  if (SKIP_VISIBILITY_CHECK)
+    message( "Skipping visibility check... " )
+  else (SKIP_VISIBILITY_CHECK)
   if (CMAKE_COMPILER_IS_GNUCXX)
    include(CheckCXXCompilerFlag)
    include(MacroEnsureVersion)
@@ -44,4 +47,5 @@
   else (CMAKE_COMPILER_IS_GNUCXX)
     set(${GccVisibility} FALSE)
   endif (CMAKE_COMPILER_IS_GNUCXX)
+  endif (SKIP_VISIBILITY_CHECK)
 endmacro(MACRO_CHECK_GCC_VISIBILITY)




More information about the kde-core-devel mailing list