diff options
author | Marcus D. Hanwell <marcus.hanwell@kitware.com> | 2011-09-20 04:16:16 (GMT) |
---|---|---|
committer | Marcus D. Hanwell <marcus.hanwell@kitware.com> | 2011-09-20 04:16:16 (GMT) |
commit | 41e2b1d824033551a63b8a10fb7f16783e0d6caa (patch) | |
tree | 64ef83ad941cbdf005c7a98240068e83e6317b2a /Modules/GenerateExportHeader.cmake | |
parent | 6a10deb670385fb8c5b584807418def67d1e02a1 (diff) | |
download | CMake-41e2b1d824033551a63b8a10fb7f16783e0d6caa.zip CMake-41e2b1d824033551a63b8a10fb7f16783e0d6caa.tar.gz CMake-41e2b1d824033551a63b8a10fb7f16783e0d6caa.tar.bz2 |
Make add_compiler_export_flags a function again.
Making this a macro had unintended issues on (among others) Windows
compilers. Moving it back to being a function using PARENT_SCOPE still
satisfies the use case where we simply want to obtain the extra flags.
Diffstat (limited to 'Modules/GenerateExportHeader.cmake')
-rw-r--r-- | Modules/GenerateExportHeader.cmake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index aaeff47..7df274e 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() macro. +# accompanying ADD_COMPILER_EXPORT_FLAGS() function. # # The GENERATE_EXPORT_HEADER function can be used to generate a file suitable # for preprocessor inclusion which contains EXPORT macros to be used in @@ -21,7 +21,7 @@ # ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] ) # # 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 +# determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS function # 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 @@ -351,7 +351,7 @@ function(GENERATE_EXPORT_HEADER TARGET_LIBRARY) _do_generate_export_header(${TARGET_LIBRARY} ${ARGN}) endfunction() -macro(add_compiler_export_flags) +function(add_compiler_export_flags) _test_compiler_hidden_visibility() _test_compiler_has_deprecated() @@ -370,8 +370,8 @@ macro(add_compiler_export_flags) # 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}") + set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE) else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) endif() -endmacro() +endfunction() |