View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014456CMake(No Category)public2013-10-02 17:452016-06-10 14:31
ReporterStephen Kelly 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0014456: Disable the compiler test for hidden_visibility in GenerateExportHeader if possible.
DescriptionIt does not need to be run if CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY is DEFINED.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0034785)
Stephen Kelly (developer)
2013-12-17 09:15

This will also require CMake built-in interfaces for deprecation.
(0035809)
Theodore Papadopoulo (reporter)
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 (administrator)
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.

 Issue History
Date Modified Username Field Change
2013-10-02 17:45 Stephen Kelly New Issue
2013-10-02 17:46 Stephen Kelly Assigned To => Stephen Kelly
2013-10-02 17:46 Stephen Kelly Status new => assigned
2013-10-02 17:46 Stephen Kelly Target Version => CMake 3.0
2013-12-17 09:15 Stephen Kelly Note Added: 0034785
2013-12-17 09:15 Stephen Kelly Target Version CMake 3.0 =>
2014-04-30 10:13 Theodore Papadopoulo Note Added: 0035809
2014-06-22 06:32 Stephen Kelly Assigned To Stephen Kelly =>
2014-06-22 06:32 Stephen Kelly Status assigned => backlog
2016-06-10 14:29 Kitware Robot Note Added: 0042382
2016-06-10 14:29 Kitware Robot Status backlog => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team