[Cmake-commits] CMake branch, next, updated. v3.6.0-819-g33aaf51

Ben Boeckel ben.boeckel at kitware.com
Wed Jul 13 09:49:15 EDT 2016


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  33aaf5180f12918392bd158c1c7278f4c83bc922 (commit)
       via  0b7c209610d1d24db3e8569b4fe8df98d138d6bb (commit)
      from  7650a137f25afc846e64a3ce9fd3da04a401a9ec (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=33aaf5180f12918392bd158c1c7278f4c83bc922
commit 33aaf5180f12918392bd158c1c7278f4c83bc922
Merge: 7650a13 0b7c209
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Jul 13 09:49:15 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 13 09:49:15 2016 -0400

    Merge topic 'geh-visibility-flag' into next
    
    0b7c2096 GenerateExportHeader: always fill in _EXPORT macros


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b7c209610d1d24db3e8569b4fe8df98d138d6bb
commit 0b7c209610d1d24db3e8569b4fe8df98d138d6bb
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: Mon Jul 11 15:19:14 2016 -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 6389d30..1f67724 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -223,9 +223,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()
 
@@ -275,7 +272,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/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 8b94ca7..875b0cf 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -124,10 +124,8 @@ 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)
 else()
   set(_platform Empty)
 endif()
diff --git a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h
deleted file mode 100644
index 808ff01..0000000
--- a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h
+++ /dev/null
@@ -1,42 +0,0 @@
-
-#ifndef LIBSHARED_EXPORT_H
-#define LIBSHARED_EXPORT_H
-
-#ifdef LIBSHARED_STATIC_DEFINE
-#  define LIBSHARED_EXPORT
-#  define LIBSHARED_NO_EXPORT
-#else
-#  ifndef LIBSHARED_EXPORT
-#    ifdef libshared_EXPORTS
-        /* We are building this library */
-#      define LIBSHARED_EXPORT
-#    else
-        /* We are using this library */
-#      define LIBSHARED_EXPORT
-#    endif
-#  endif
-
-#  ifndef LIBSHARED_NO_EXPORT
-#    define LIBSHARED_NO_EXPORT
-#  endif
-#endif
-
-#ifndef LIBSHARED_DEPRECATED
-#  define LIBSHARED_DEPRECATED __attribute__ ((__deprecated__))
-#endif
-
-#ifndef LIBSHARED_DEPRECATED_EXPORT
-#  define LIBSHARED_DEPRECATED_EXPORT LIBSHARED_EXPORT LIBSHARED_DEPRECATED
-#endif
-
-#ifndef LIBSHARED_DEPRECATED_NO_EXPORT
-#  define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED
-#endif
-
-#if 0 /* DEFINE_NO_DEPRECATED */
-#  ifndef LIBSHARED_NO_DEPRECATED
-#    define LIBSHARED_NO_DEPRECATED
-#  endif
-#endif
-
-#endif
diff --git a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h
deleted file mode 100644
index 4aaa848..0000000
--- a/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h
+++ /dev/null
@@ -1,42 +0,0 @@
-
-#ifndef LIBSTATIC_EXPORT_H
-#define LIBSTATIC_EXPORT_H
-
-#ifdef LIBSTATIC_STATIC_DEFINE
-#  define LIBSTATIC_EXPORT
-#  define LIBSTATIC_NO_EXPORT
-#else
-#  ifndef LIBSTATIC_EXPORT
-#    ifdef libstatic_EXPORTS
-        /* We are building this library */
-#      define LIBSTATIC_EXPORT
-#    else
-        /* We are using this library */
-#      define LIBSTATIC_EXPORT
-#    endif
-#  endif
-
-#  ifndef LIBSTATIC_NO_EXPORT
-#    define LIBSTATIC_NO_EXPORT
-#  endif
-#endif
-
-#ifndef LIBSTATIC_DEPRECATED
-#  define LIBSTATIC_DEPRECATED __attribute__ ((__deprecated__))
-#endif
-
-#ifndef LIBSTATIC_DEPRECATED_EXPORT
-#  define LIBSTATIC_DEPRECATED_EXPORT LIBSTATIC_EXPORT LIBSTATIC_DEPRECATED
-#endif
-
-#ifndef LIBSTATIC_DEPRECATED_NO_EXPORT
-#  define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED
-#endif
-
-#if 0 /* DEFINE_NO_DEPRECATED */
-#  ifndef LIBSTATIC_NO_DEPRECATED
-#    define LIBSTATIC_NO_DEPRECATED
-#  endif
-#endif
-
-#endif

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

Summary of changes:
 Modules/GenerateExportHeader.cmake                 |    8 ++--
 Tests/Module/GenerateExportHeader/CMakeLists.txt   |    4 +-
 .../UNIX_DeprecatedOnly/libshared_export.h         |   42 --------------------
 .../UNIX_DeprecatedOnly/libstatic_export.h         |   42 --------------------
 4 files changed, 5 insertions(+), 91 deletions(-)
 delete mode 100644 Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h
 delete mode 100644 Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list