[Cmake-commits] CMake branch, next, updated. v2.8.5-1920-g12ef1e8

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Sep 19 16:45:40 EDT 2011


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  12ef1e870566649c81392428de48275f39e73b23 (commit)
       via  6a10deb670385fb8c5b584807418def67d1e02a1 (commit)
      from  33e1a63ca1084abf76939f8a4a6bf112d69abcde (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12ef1e870566649c81392428de48275f39e73b23
commit 12ef1e870566649c81392428de48275f39e73b23
Merge: 33e1a63 6a10deb
Author:     Marcus D. Hanwell <marcus.hanwell at kitware.com>
AuthorDate: Mon Sep 19 16:45:36 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 19 16:45:36 2011 -0400

    Merge topic 'generate-export-header' into next
    
    6a10deb Made ADD_COMPILER_EXPORT_FLAGS into a macro.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a10deb670385fb8c5b584807418def67d1e02a1
commit 6a10deb670385fb8c5b584807418def67d1e02a1
Author:     Marcus D. Hanwell <marcus.hanwell at kitware.com>
AuthorDate: Mon Sep 19 16:42:42 2011 -0400
Commit:     Marcus D. Hanwell <marcus.hanwell at kitware.com>
CommitDate: Mon Sep 19 16:42:42 2011 -0400

    Made ADD_COMPILER_EXPORT_FLAGS into a macro.
    
    It adds to the CMAKE_CXX_FLAGS (as before), or populates the supplied
    optional argument with the CXX_FLAGS for symbol import/export.

diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index f2eaf8c..aaeff47 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -1,6 +1,6 @@
 # - Function for generation of export macros for libraries
 # This module provides the function GENERATE_EXPORT_HEADER() and the
-# accompanying ADD_COMPILER_EXPORT_FLAGS() function.
+# accompanying ADD_COMPILER_EXPORT_FLAGS() macro.
 #
 # The GENERATE_EXPORT_HEADER function can be used to generate a file suitable
 # for preprocessor inclusion which contains EXPORT macros to be used in
@@ -22,8 +22,11 @@
 #
 # By default GENERATE_EXPORT_HEADER() generates macro names in a file name
 # determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS macro
-# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on Windows
-# which does not need extra compiler flags for exporting support.
+# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on
+# Windows which does not need extra compiler flags for exporting support. You
+# may optionally pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will
+# be populated with the required CXX_FLAGS required to enable visibility support
+# for the compiler/architecture in use.
 #
 # This means that in the simplest case, users of these functions will be
 # equivalent to:
@@ -229,7 +232,8 @@ macro(_test_compiler_has_deprecated)
   endif()
 endmacro()
 
-get_filename_component(_GENERATE_EXPORT_HEADER_MODULE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_GENERATE_EXPORT_HEADER_MODULE_DIR
+  "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
 macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
   set(DEFINE_DEPRECATED)
@@ -347,7 +351,7 @@ function(GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   _do_generate_export_header(${TARGET_LIBRARY} ${ARGN})
 endfunction()
 
-function(add_compiler_export_flags)
+macro(add_compiler_export_flags)
 
   _test_compiler_hidden_visibility()
   _test_compiler_has_deprecated()
@@ -362,5 +366,12 @@ function(add_compiler_export_flags)
   if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
     set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden")
   endif()
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE)
-endfunction()
+
+  # Either return the extra flags needed in the supplied argument, or to the
+  # CMAKE_CXX_FLAGS if no argument is supplied.
+  if(ARGV0)
+    set(${ARGV0} "${EXTRA_FLAGS}")
+  else()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}")
+  endif()
+endmacro()

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

Summary of changes:
 Modules/GenerateExportHeader.cmake |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list