1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-08 22:37:04 +08:00
CMake/Tests/RunCMake/CMP0194/RunCMakeTest.cmake
Brad King 14212494bb ASM: Guard exclusion of MSVC C/CXX compiler with a policy
Since commit 6baf65ec46 (ASM: Do not consider MSVC C/CXX compiler for
generic ASM, 2025-04-08) we no longer mistake `cl` for an assembler.
However, some projects unconditionally enable ``ASM``, which worked
on Windows only due to that bug.  Restore compatibility with such
projects by guarding the change behind a new policy ``CMP0194``.

Fixes: #26907
Issue: #26617
2025-05-03 13:18:19 -04:00

11 lines
351 B
CMake

include(RunCMake)
# The test cases empty the PATH before enabling ASM to avoid finding
# another assembler in the caller's environment. However, old
# versions of MSVC do not support running `cl` without the PATH set.
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 16)
run_cmake(CMP0194-WARN)
run_cmake(CMP0194-OLD)
endif()
run_cmake(CMP0194-NEW)