[Cmake-commits] CMake branch, next, updated. v3.6.0-838-g010197d

Brad King brad.king at kitware.com
Thu Jul 14 09:03:00 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  010197d9156e54542b1e2a1d5b3be1bc1244ccbc (commit)
       via  2656cb2519350f8aec7a08b8d31df1d1a53b581b (commit)
      from  e8deca398385c587e4aa902577870176ae13f133 (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=010197d9156e54542b1e2a1d5b3be1bc1244ccbc
commit 010197d9156e54542b1e2a1d5b3be1bc1244ccbc
Merge: e8deca3 2656cb2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 14 09:02:58 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 14 09:02:58 2016 -0400

    Merge topic 'geh-visibility-flag' into next
    
    2656cb25 Revert "GenerateExportHeader: always fill in _EXPORT macros"


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2656cb2519350f8aec7a08b8d31df1d1a53b581b
commit 2656cb2519350f8aec7a08b8d31df1d1a53b581b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 14 09:02:24 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 14 09:02:24 2016 -0400

    Revert "GenerateExportHeader: always fill in _EXPORT macros"
    
    This reverts commit 0b7c209610d1d24db3e8569b4fe8df98d138d6bb.
    It fails tests on HP-UX and AIX.

diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 1f67724..6389d30 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -223,6 +223,9 @@ 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()
 
@@ -272,7 +275,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)
+    elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
       set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))")
       set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))")
       set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))")
@@ -385,9 +388,6 @@ 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 875b0cf..8b94ca7 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -124,8 +124,10 @@ if (WIN32 OR CYGWIN)
   else()
     set(_platform WinEmpty)
   endif()
-elseif(COMPILER_HAS_HIDDEN_VISIBILITY)
+elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_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
new file mode 100644
index 0000000..808ff01
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h
@@ -0,0 +1,42 @@
+
+#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
new file mode 100644
index 0000000..4aaa848
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h
@@ -0,0 +1,42 @@
+
+#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 +++-
 .../{Empty => UNIX_DeprecatedOnly}/libshared_export.h          |    2 +-
 .../{MinGW => UNIX_DeprecatedOnly}/libstatic_export.h          |    0
 4 files changed, 8 insertions(+), 6 deletions(-)
 copy Tests/Module/GenerateExportHeader/reference/{Empty => UNIX_DeprecatedOnly}/libshared_export.h (93%)
 copy Tests/Module/GenerateExportHeader/reference/{MinGW => UNIX_DeprecatedOnly}/libstatic_export.h (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list