[Cmake-commits] CMake branch, next, updated. v3.8.0-rc2-493-g925b214

Kitware Robot kwrobot at kitware.com
Wed Mar 15 09:15:03 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  925b2149727b556f0df6873c1b60dafe466dcf59 (commit)
       via  16d114e3126fcf06d33e734d074dcd4f5542e074 (commit)
      from  af21531a8fa644afa2e7da0a27a90f16598597a3 (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=925b2149727b556f0df6873c1b60dafe466dcf59
commit 925b2149727b556f0df6873c1b60dafe466dcf59
Merge: af21531 16d114e
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Mar 15 13:09:45 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 15 09:09:50 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=16d114e3126fcf06d33e734d074dcd4f5542e074
commit 16d114e3126fcf06d33e734d074dcd4f5542e074
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: Tue Mar 14 12:08:37 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..4d5059d 100644
--- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
@@ -110,10 +110,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/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h b/Tests/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h
deleted file mode 100644
index 808ff01..0000000
--- a/Tests/RunCMake/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/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h b/Tests/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h
deleted file mode 100644
index 4aaa848..0000000
--- a/Tests/RunCMake/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/RunCMake/GenerateExportHeader/GEH.cmake      |    4 +-
 .../UNIX_DeprecatedOnly/libshared_export.h         |   42 --------------------
 .../UNIX_DeprecatedOnly/libstatic_export.h         |   42 --------------------
 4 files changed, 5 insertions(+), 91 deletions(-)
 delete mode 100644 Tests/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h
 delete mode 100644 Tests/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list