Files
cmake/Tests/RunCMake/CompilerChange/ToolchainFromFileDeleted-step2-prep.cmake
Aiden Woodruff ee6bfdc1f3 CMAKE_TOOLCHAIN_FILE: Improve recovery from changed compiler or toolchain file
Replace __CMAKE_DELETE_CACHE_CHANGE_VARS_ with a set of changed
variables in cmState to avoid interference from scripts and simplify
handling of changed variables.

Errors during configure step will block re-configure when the toolchain
file has changed. Downstream errors can be caused by failing in
EnableLanguage without an error, behavior introduced in 7a989ed58a
(CMAKE_TOOLCHAIN_FILE: Detect path changes and reset cache, 2026-06-24).
Errors directly related to a changed toolchain file should be fixed by
using the new one.

Trigger a fatal error when the toolchain file change is detected to
avoid wasteful configure that will be reset anyway, then re-configure
only for that specific case. Avoid re-configuring multiple times.

Fixes: #27867
2026-07-03 09:25:33 -04:00

6 lines
146 B
CMake

file(REMOVE "${RunCMake_BINARY_DIR}/baz.cmake")
file(WRITE
"${RunCMake_TEST_BINARY_DIR}/toolchain.txt"
"${RunCMake_BINARY_DIR}/bar.cmake\n"
)