[Cmake-commits] CMake branch, next, updated. v2.8.5-1485-g2de4471
Stephen Kelly
steveire at gmail.com
Wed Aug 10 15:29:42 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 2de4471256fc40a1d6c13b5199e3efdaa57e32ba (commit)
via bab4a22036a988f49e1b711d092416c18cc16870 (commit)
via cff94935982def7302cca11d521bf55587b8ebf7 (commit)
from de83ca6e51c191db2e6231f85c0cfbe18ddc0e65 (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=2de4471256fc40a1d6c13b5199e3efdaa57e32ba
commit 2de4471256fc40a1d6c13b5199e3efdaa57e32ba
Merge: de83ca6 bab4a22
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 10 15:29:38 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 10 15:29:38 2011 -0400
Merge topic 'generate_export_header' into next
bab4a22 Disable all export macros on Borland.
cff9493 Only set the COMPILER_HAS_HIDDEN_VISIBILITY if GCC >= 4.2
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bab4a22036a988f49e1b711d092416c18cc16870
commit bab4a22036a988f49e1b711d092416c18cc16870
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 10 21:28:42 2011 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Aug 10 21:28:42 2011 +0200
Disable all export macros on Borland.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index cb7b0d8..1395f15 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -148,7 +148,7 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
set(DEFINE_IMPORT)
set(DEFINE_NO_EXPORT)
- if(WIN32)
+ if(WIN32 AND NOT (${CMAKE_CXX_COMPILER_ID} MATCHES Borland))
set(DEFINE_DEPRECATED "__declspec(deprecated)")
else()
set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))")
@@ -157,7 +157,7 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
if(NOT ${type} STREQUAL "STATIC_LIBRARY")
- if(WIN32)
+ if(WIN32 AND NOT (${CMAKE_CXX_COMPILER_ID} MATCHES Borland))
set(DEFINE_EXPORT "__declspec(dllexport)")
set(DEFINE_IMPORT "__declspec(dllimport)")
elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cff94935982def7302cca11d521bf55587b8ebf7
commit cff94935982def7302cca11d521bf55587b8ebf7
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Aug 10 21:13:33 2011 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Aug 10 21:14:46 2011 +0200
Only set the COMPILER_HAS_HIDDEN_VISIBILITY if GCC >= 4.2
Hearsay has it that before that version it didn't work properly.
Hopefully this will fix more dashboard builds.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 7e644b1..cb7b0d8 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -116,10 +116,28 @@ include(CMakeParseArguments)
include(CheckCXXCompilerFlag)
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)
+
+ if (CMAKE_COMPILER_IS_GNUCXX)
+ exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
+ string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
+ # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
+ # patch level, handle this here:
+ if(NOT _gcc_version)
+ string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}")
+ endif()
+
+ if(${_gcc_version} VERSION_LESS "4.2")
+ set(GCC_TOO_OLD TRUE)
+ message(WARNING "GCC version older than 4.2")
+ endif()
+ endif()
+
+ if (NOT GCC_TOO_OLD)
+ 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()
set(myDir ${CMAKE_CURRENT_LIST_DIR})
@@ -233,21 +251,6 @@ function(add_compiler_export_flags)
return()
endif()
- if (CMAKE_COMPILER_IS_GNUCXX)
- exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
- # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
- # patch level, handle this here:
- if(NOT _gcc_version)
- string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}")
- endif()
-
- if(${_gcc_version} VERSION_LESS "4.2")
- message(WARNING "GCC version older than 4.2")
- return()
- endif()
- endif()
-
set (EXTRA_FLAGS "-fvisibility=hidden")
if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 0cc67a9..064b9e3 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -76,24 +76,9 @@ macro(_do_build Include Library LibrarySource Source)
)
endmacro()
-if (CMAKE_COMPILER_IS_GNUCXX)
- exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
- # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
- # patch level, handle this here:
- if(NOT _gcc_version)
- string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}")
- endif()
-
- if(${_gcc_version} VERSION_LESS "4.2")
- set(GCC_IS_LESS_THAN_4_2 TRUE)
- message(WARNING "GCC version older than 4.2. Actual version: ${_gcc_version}")
- endif()
-endif()
-
macro(build_fail Include Library LibrarySource Source Message)
_do_build(${Include} ${Library} ${LibrarySource} "${Source}")
- if(NOT GCC_IS_LESS_THAN_4_2 AND (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY) OR WIN32 OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
+ if(COMPILER_HAS_HIDDEN_VISIBILITY OR WIN32 OR (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
test_fail(Result ${Message})
else()
test_pass(Result ${Message})
-----------------------------------------------------------------------
Summary of changes:
Modules/GenerateExportHeader.cmake | 45 +++++++++++----------
Tests/Module/GenerateExportHeader/CMakeLists.txt | 17 +--------
2 files changed, 25 insertions(+), 37 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list