summaryrefslogtreecommitdiffstats
path: root/modules/TDEMacros.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-02-03 18:41:54 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-02-03 19:27:34 +0100
commit84071b3095cd05d6a0a4c41e4089da4656f39e48 (patch)
tree760573ae7b862acb83fe5157d7682021d2215b55 /modules/TDEMacros.cmake
parentc07c746718f90874b550740d65756409cd8c8bc5 (diff)
downloadtde-cmake-84071b3095cd05d6a0a4c41e4089da4656f39e48.tar.gz
tde-cmake-84071b3095cd05d6a0a4c41e4089da4656f39e48.zip
Update tde_setup_gcc_visibility macro
+ In the test include kdemacros.h with detected full path to avoid FTBFS. + Do not test gcc visibility on TDE unless the current module uses TDE. + Do not test gcc visibility on TQt unless the current module uses TQt. + Improve test for gcc visibility on TQt to make it more accurate. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit f8254e1561c2a5a884a6f812ee5a0fdcf22c7884)
Diffstat (limited to 'modules/TDEMacros.cmake')
-rw-r--r--modules/TDEMacros.cmake64
1 files changed, 34 insertions, 30 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index d675b31..612e1c8 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -1719,37 +1719,41 @@ macro( tde_setup_gcc_visibility )
tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" )
endif( NOT UNIX )
- find_library( TQT_LIBFILE qt-mt HINTS "${TQT_LIBRARY_DIRS}" )
- if( NOT "${TQT_LIBFILE}" STREQUAL "TQT_LIBFILE-NOTFOUND" )
- message( STATUS "Performing Test HAVE_TQT_VISIBILITY" )
- execute_process(
- COMMAND readelf --syms "${TQT_LIBFILE}"
- OUTPUT_VARIABLE HAVE_TQT_VISIBILITY
- )
- if( "${HAVE_TQT_VISIBILITY}" STREQUAL "" OR
- "${HAVE_TQT_VISIBILITY}" MATCHES "DEFAULT[^\n]*QSettingsPrivate" )
- message( STATUS "Performing Test HAVE_TQT_VISIBILITY - Failed" )
- tde_message_fatal( "gcc visibility support was requested, but not supported in qt library" )
+ if( TQT_FOUND )
+ find_library( TQT_LIBFILE qt-mt HINTS "${TQT_LIBRARY_DIRS}" )
+ if( NOT "${TQT_LIBFILE}" STREQUAL "TQT_LIBFILE-NOTFOUND" )
+ message( STATUS "Performing Test HAVE_TQT_VISIBILITY" )
+ execute_process(
+ COMMAND readelf --syms "${TQT_LIBFILE}"
+ OUTPUT_VARIABLE HAVE_TQT_VISIBILITY
+ )
+ if( "${HAVE_TQT_VISIBILITY}" STREQUAL "" OR
+ "${HAVE_TQT_VISIBILITY}" MATCHES "GLOBAL[\t ]+DEFAULT[^\n]+QSettingsPrivate" )
+ message( STATUS "Performing Test HAVE_TQT_VISIBILITY - Failed" )
+ tde_message_fatal( "gcc visibility support was requested, but not supported in qt library" )
+ endif( )
+ message( STATUS "Performing Test HAVE_TQT_VISIBILITY - Success" )
endif( )
- message( STATUS "Performing Test HAVE_TQT_VISIBILITY - Success" )
- endif( )
-
- find_file( TDEMACROS_H kdemacros.h HINTS "${TDE_INCLUDE_DIR}" )
- if( NOT "${TDEMACROS_H}" STREQUAL "TDEMACROS_H-NOTFOUND" )
- tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" )
- check_cxx_source_compiles( "
- #include <kdemacros.h>
- #ifndef __KDE_HAVE_GCC_VISIBILITY
- #error gcc visibility is not enabled in tdelibs
- #endif
- int main() { return 0; } "
- HAVE_TDE_VISIBILITY
- )
- tde_restore( CMAKE_REQUIRED_INCLUDES )
- if( NOT HAVE_TDE_VISIBILITY )
- tde_message_fatal( "gcc visibility support was requested, but not supported in tdelibs" )
- endif( NOT HAVE_TDE_VISIBILITY )
- endif( )
+ endif( TQT_FOUND )
+
+ if( TDE_FOUND )
+ find_file( TDEMACROS_H kdemacros.h HINTS "${TDE_INCLUDE_DIR}" )
+ if( NOT "${TDEMACROS_H}" STREQUAL "TDEMACROS_H-NOTFOUND" )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" )
+ check_cxx_source_compiles( "
+ #include <${TDEMACROS_H}>
+ #ifndef __KDE_HAVE_GCC_VISIBILITY
+ #error gcc visibility is not enabled in tdelibs
+ #endif
+ int main() { return 0; } "
+ HAVE_TDE_VISIBILITY
+ )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
+ if( NOT HAVE_TDE_VISIBILITY )
+ tde_message_fatal( "gcc visibility support was requested, but not supported in tdelibs" )
+ endif( NOT HAVE_TDE_VISIBILITY )
+ endif( )
+ endif( TDE_FOUND )
set( __KDE_HAVE_GCC_VISIBILITY 1 )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")