diff options
author | Brad King <brad.king@kitware.com> | 2023-01-30 21:09:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-01 14:32:42 (GMT) |
commit | 5252c885693ce35467f6c4c7fdc8deb6406df149 (patch) | |
tree | 35704c91a461029b32411307789d096df0a52a10 /Tests | |
parent | 0a48d8fe5ccf8a44bcada7b528f4cf4dd591b18e (diff) | |
download | CMake-5252c885693ce35467f6c4c7fdc8deb6406df149.zip CMake-5252c885693ce35467f6c4c7fdc8deb6406df149.tar.gz CMake-5252c885693ce35467f6c4c7fdc8deb6406df149.tar.bz2 |
try_compile: Record propagated CMake variables in configure log
These provide more detailed information about how the test project was
configured.
Issue: #23200
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/try_compile/ConfigureLog-config.txt | 13 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/ConfigureLog.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/try_compile/Inspect-config.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/try_run/ConfigureLog-config.txt | 15 |
4 files changed, 47 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt index 42c1278..ef5c73e 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -20,6 +20,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "CMAKE_C_ABI_COMPILED" cached: true @@ -41,6 +44,13 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables: + ABCDEFGHIJKLMNOPQRSTUVWXYZ: "Upper case"( + CMAKE_[^ +]*)+ + "WITH SPACE": "Space" + _-0123456789: "Other chars" + abcdefghijklmnopqrstuvwxyz: "Lower case" buildResult: variable: "COMPILE_RESULT" cached: true @@ -58,6 +68,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "COMPILE_RESULT" cached: true diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake index 294e0f9..a897719 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog.cmake +++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake @@ -1,10 +1,23 @@ enable_language(C) +set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + _-0123456789 + "WITH SPACE" + ) +set(ABCDEFGHIJKLMNOPQRSTUVWXYZ "Upper case") +set(abcdefghijklmnopqrstuvwxyz "Lower case") +set(_-0123456789 "Other chars") +set("WITH SPACE" "Space") + try_compile(COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c LOG_DESCRIPTION "Source that should not compile." ) +unset(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES) + try_compile(COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c NO_LOG diff --git a/Tests/RunCMake/try_compile/Inspect-config.txt b/Tests/RunCMake/try_compile/Inspect-config.txt index b0f90e5..44bd443 100644 --- a/Tests/RunCMake/try_compile/Inspect-config.txt +++ b/Tests/RunCMake/try_compile/Inspect-config.txt @@ -20,6 +20,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "CMAKE_C_ABI_COMPILED" cached: true @@ -44,6 +47,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "CMAKE_CXX_ABI_COMPILED" cached: true diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt index a68472c..e1d5fa7 100644 --- a/Tests/RunCMake/try_run/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt @@ -19,6 +19,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "CMAKE_C_ABI_COMPILED" cached: true @@ -40,6 +43,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "COMPILE_RESULT" cached: true @@ -59,6 +65,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "COMPILE_RESULT" cached: true @@ -83,6 +92,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "COMPILE_RESULT" cached: true @@ -103,6 +115,9 @@ events:( directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/"]+" + cmakeVariables:( + CMAKE_[^ +]*)+ buildResult: variable: "COMPILE_RESULT" cached: true |