[Cmake-commits] CMake branch, master, updated. v3.8.1-1120-g8cc9e07
Kitware Robot
kwrobot at kitware.com
Wed May 10 09:45: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, master has been updated
via 8cc9e07a2ca7018feb0dbc286f1db23a4294eeec (commit)
via d49aa10768fba4c2cb113d49629138140b37d560 (commit)
from d43eb3aec2419284c8491b0f8334ca47d0a6e334 (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=8cc9e07a2ca7018feb0dbc286f1db23a4294eeec
commit 8cc9e07a2ca7018feb0dbc286f1db23a4294eeec
Merge: d43eb3a d49aa10
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed May 10 13:36:10 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed May 10 09:36:16 2017 -0400
Merge topic 'sunpro-c++11-link'
d49aa107 Features: On SunPro link feature check with lang std flag
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !818
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d49aa10768fba4c2cb113d49629138140b37d560
commit d49aa10768fba4c2cb113d49629138140b37d560
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue May 9 11:18:54 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue May 9 11:22:18 2017 -0400
Features: On SunPro link feature check with lang std flag
Follow up commit e17b179184 (Features: On SunPro link with language
standard compiler flag, 2017-04-28) to apply the same fix to the feature
checks. The `try_compile` used for these is intentionally not using
`CXX_STANDARD`-based logic so that it can test the individual flags.
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index 50b8526..de336e7 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -22,9 +22,18 @@ macro(_record_compiler_features lang compile_flags feature_list)
file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}"
"\n};\n\nint main(int argc, char** argv) { (void)argv; return features[argc]; }\n")
+ if(CMAKE_${lang}_LINK_WITH_STANDARD_COMPILE_OPTION)
+ # This toolchain requires use of the language standard flag
+ # when linking in order to use the matching standard library.
+ set(compile_flags_for_link "${compile_flags}")
+ else()
+ set(compile_flags_for_link "")
+ endif()
+
try_compile(CMAKE_${lang}_FEATURE_TEST
${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}"
COMPILE_DEFINITIONS "${compile_flags}"
+ LINK_LIBRARIES "${compile_flags_for_link}"
OUTPUT_VARIABLE _output
COPY_FILE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin"
COPY_FILE_ERROR _copy_error
@@ -35,6 +44,7 @@ macro(_record_compiler_features lang compile_flags feature_list)
set(_result 255)
endif()
unset(CMAKE_${lang}_FEATURE_TEST CACHE)
+ unset(compile_flags_for_link)
if (_result EQUAL 0)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-----------------------------------------------------------------------
Summary of changes:
Modules/Internal/FeatureTesting.cmake | 10 ++++++++++
1 file changed, 10 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list