Notes |
|
(0034785)
|
Stephen Kelly
|
2013-12-17 09:15
|
|
This will also require CMake built-in interfaces for deprecation. |
|
|
(0035809)
|
Theodore Papadopoulo
|
2014-04-30 10:13
|
|
Actually the test _test_compiler_hidden_visibility is also a C++ test which does not work for C only projects. Turning it into a C/C++ test would be a bonus.
Something along the lines (untested though):
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index f83f992..0037842 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -221,12 +221,20 @@ macro(_test_compiler_hidden_visibility)
AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL
AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI
AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom)
- 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)
+ get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
+ if (_LANGUAGES_ MATCHES CXX)
+ check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
+ check_cxx_compiler_flag(-fvisibility-inlines-hidden
+ COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
+ else()
+ check_c_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
+ check_c_compiler_flag(-fvisibility-inlines-hidden
+ endif()
+ if (COMPILER_HAS_HIDDEN_VISIBILITY)
+ option(USE_COMPILER_HIDDEN_VISIBILITY
+ "Use HIDDEN visibility support if available." ON)
+ mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY)
+ endif()
endif()
endmacro() |
|
|
(0042382)
|
Kitware Robot
|
2016-06-10 14:29
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|