summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-22 16:19:39 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-22 16:26:28 (GMT)
commit80fc564dd7cbebc374a18fb57c71472dac5de6c1 (patch)
treeed2af4b1fc85a3c4c36cdd77cca2e43d276ed065 /Tests
parent0a802d0f9ef2b0a0150382d6e988f5d2a78eeb64 (diff)
downloadCMake-80fc564dd7cbebc374a18fb57c71472dac5de6c1.zip
CMake-80fc564dd7cbebc374a18fb57c71472dac5de6c1.tar.gz
CMake-80fc564dd7cbebc374a18fb57c71472dac5de6c1.tar.bz2
try_compile: Restore COPY_FILE with CMAKE_TRY_COMPILE_CONFIGURATION
Since commit 0c141b0393 (try_compile: Record output location instead of reverse computing it, 2022-08-31, v3.25.0-rc1~154^2) we always look for the "Debug" configuration's output binary from the test project. Restore looking for the `CMAKE_TRY_COMPILE_CONFIGURATION`. Fixes: #24180
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/try_compile/CopyFileConfig.cmake8
-rw-r--r--Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake1
2 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/CopyFileConfig.cmake b/Tests/RunCMake/try_compile/CopyFileConfig.cmake
new file mode 100644
index 0000000..22d20b7
--- /dev/null
+++ b/Tests/RunCMake/try_compile/CopyFileConfig.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS})
+try_compile(RESULT
+ ${try_compile_bindir_or_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/out.bin"
+ )
diff --git a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake
index ac07ad3..3158e32 100644
--- a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake
+++ b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake
@@ -23,6 +23,7 @@ run_cmake(TryRunArgs)
run_cmake(BuildType)
run_cmake(BuildTypeAsFlag)
run_cmake(OutputDirAsFlag)
+run_cmake(CopyFileConfig)
run_cmake(EnvConfig)