summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)