summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-20 15:52:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-03-20 15:52:06 (GMT)
commit01bdc2cc43def6797e40037859cb72981c7342b8 (patch)
treee17eada55988da17a3e4d1947dc4dae7d28362b6
parente145cfe2e9d4afac060754097dee0b9439d470d7 (diff)
parent9eb05b48cd8e19988e5a579996598802e2bacdea (diff)
downloadCMake-01bdc2cc43def6797e40037859cb72981c7342b8.zip
CMake-01bdc2cc43def6797e40037859cb72981c7342b8.tar.gz
CMake-01bdc2cc43def6797e40037859cb72981c7342b8.tar.bz2
Merge topic 'geh-visibility-flag'
9eb05b48 GenerateExportHeader: always fill in _EXPORT macros Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !36
-rw-r--r--Modules/GenerateExportHeader.cmake8
-rw-r--r--Tests/RunCMake/GenerateExportHeader/GEH.cmake2
2 files changed, 5 insertions, 5 deletions
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 6d1b4ed..4573c2e 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -215,9 +215,6 @@ macro(_test_compiler_hidden_visibility)
check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
check_cxx_compiler_flag(-fvisibility-inlines-hidden
COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
- option(USE_COMPILER_HIDDEN_VISIBILITY
- "Use HIDDEN visibility support if available." ON)
- mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY)
endif()
endmacro()
@@ -267,7 +264,7 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
if(WIN32 OR CYGWIN)
set(DEFINE_EXPORT "__declspec(dllexport)")
set(DEFINE_IMPORT "__declspec(dllimport)")
- elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
+ elseif(COMPILER_HAS_HIDDEN_VISIBILITY)
set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))")
@@ -388,6 +385,9 @@ function(add_compiler_export_flags)
_test_compiler_hidden_visibility()
_test_compiler_has_deprecated()
+ option(USE_COMPILER_HIDDEN_VISIBILITY
+ "Use HIDDEN visibility support if available." ON)
+ mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY)
if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY))
# Just return if there are no flags to add.
return()
diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
index cddba29..e0677a7 100644
--- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
@@ -110,7 +110,7 @@ if (WIN32 OR CYGWIN)
else()
set(_platform WinEmpty)
endif()
-elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
+elseif(COMPILER_HAS_HIDDEN_VISIBILITY)
set(_platform UNIX)
elseif(COMPILER_HAS_DEPRECATED)
set(_platform UNIX_DeprecatedOnly)