diff options
author | Brad King <brad.king@kitware.com> | 2023-01-18 19:33:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-01-18 21:40:19 (GMT) |
commit | 95976514f605e83c4db5e1dd176398653b0d42cd (patch) | |
tree | 2224ace15f0f84096ecc1fd941e4373003e5ceda /Tests/RunCMake/try_compile | |
parent | 20bbd5f3d3b63fcf1f62e1df3ec8ce3ba30d288b (diff) | |
download | CMake-95976514f605e83c4db5e1dd176398653b0d42cd.zip CMake-95976514f605e83c4db5e1dd176398653b0d42cd.tar.gz CMake-95976514f605e83c4db5e1dd176398653b0d42cd.tar.bz2 |
Tests: Avoid using CMake{Output,Error}.log files
These log files will soon go away, so avoid using them in tests.
Diffstat (limited to 'Tests/RunCMake/try_compile')
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0128-common.cmake | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/Tests/RunCMake/try_compile/CMP0128-common.cmake b/Tests/RunCMake/try_compile/CMP0128-common.cmake index 0b8a12b..64b1a77 100644 --- a/Tests/RunCMake/try_compile/CMP0128-common.cmake +++ b/Tests/RunCMake/try_compile/CMP0128-common.cmake @@ -1,10 +1,6 @@ cmake_policy(SET CMP0067 NEW) enable_language(CXX) -# Isolate the one try_compile below in the error log. -set(CMakeError_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log") -file(REMOVE "${CMakeError_log}") - # Add our own -std= flag to the try_compile check. set(CMAKE_REQUIRED_FLAGS -std=c++11) @@ -24,8 +20,21 @@ int main() } " SRC_COMPILED) if(NOT SRC_COMPILED) - if(EXISTS "${CMakeError_log}") - file(READ "${CMakeError_log}" err_log) + message("Check failed to compile:") + set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml") + if(EXISTS "${configure_log}") + file(READ "${configure_log}" log_content) + else() + set(log_content "") + endif() + if(log_content MATCHES [[( - + kind: "try_compile-v1"( ++ [^ +]+)+ + checks: + - "Performing Test SRC_COMPILED"( ++ [^ +]+)+)]]) + message("${configure_log} contains:\n${CMAKE_MATCH_1}") endif() - message("${err_log}") endif() |