[Cmake-commits] CMake branch, next, updated. v3.8.0-rc2-502-gcca0fbc

Kitware Robot kwrobot at kitware.com
Fri Mar 17 10:35:05 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  cca0fbc067eb2bdfb74dd87a714562db5f236940 (commit)
       via  9eb05b48cd8e19988e5a579996598802e2bacdea (commit)
      from  8a6a1f4984644e1eb20d9bdc866e9ae8c1c7e375 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cca0fbc067eb2bdfb74dd87a714562db5f236940
commit cca0fbc067eb2bdfb74dd87a714562db5f236940
Merge: 8a6a1f4 9eb05b4
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Mar 17 14:30:50 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 17 10:30:54 2017 -0400

    Stage topic 'geh-visibility-flag'
    
    Topic-id: 17427
    Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/36


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9eb05b48cd8e19988e5a579996598802e2bacdea
commit 9eb05b48cd8e19988e5a579996598802e2bacdea
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Jul 11 14:52:05 2016 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Thu Mar 16 15:11:03 2017 -0400

    GenerateExportHeader: always fill in _EXPORT macros
    
    The `_EXPORT` and `_NO_EXPORT` macros should always be made properly
    because the `<LANG>_VISIBILITY_PRESET` properties are controlled
    independently of this module.
    
    One case where this breaks compatibility is where a project was setting
    `USE_COMPILER_HIDDEN_VISIBILITY=OFF` and then marking a symbol used
    outside of the library with `_NO_EXPORT` which is a contridiction.

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)

-----------------------------------------------------------------------

Summary of changes:
 Modules/GenerateExportHeader.cmake            |    8 ++++----
 Tests/RunCMake/GenerateExportHeader/GEH.cmake |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list