Files
Fabrice de Gans d75d5dfadf ASM: Record all assembler id information
Previously, `CMAKE_ASM${DIALECT}_COMPILER_FRONTEND_VARIANT` and
`CMAKE_ASM${DIALECT}_SIMULATE_ID` were not saved in with the build
configuration. As a result, these were left unpopulated on re-configure.
This is particularly problematic when `clang-cl` is used as the
assembler on Windows, since CMake would mistakenly identify the build as
being "GCC on Windows", resulting in include paths being passed with
forward slashes on re-configure, causing a full rebuild.

Fix the issue by saving the information so it persists across
re-configures.
2026-08-08 10:51:14 -04:00

15 lines
443 B
CMake

include(RunCMake)
block()
# The stand-in assembler reports an MSVC-like command-line by default and a
# GNU-like one when PSEUDO_ASM_GNU is set, which selects the two branches of
# assembler identification that populate these fields differently.
set(RunCMake_TEST_OPTIONS "-DCMAKE_ASM_COMPILER=${PSEUDO_ASM}")
run_cmake(ASM-clang-cl)
set(ENV{PSEUDO_ASM_GNU} 1)
run_cmake(ASM-clang-gnu)
unset(ENV{PSEUDO_ASM_GNU})
endblock()