mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 06:39:25 +08:00
ce12bbaefd
clang-cl emits CMAKE_CXX_COMPILER_ID="Clang" with CMAKE_CXX_SIMULATE_ID="MSVC" because it is the LLVM driver running on top of MSVC's headers and CRT. The previous flag selector keyed strictly on CMAKE_CXX_COMPILER_ID == "MSVC", so clang-cl fell into the GCC/Clang flag branch and tried to forward switches the cl-style driver rejects (e.g. -fdata-sections, GCC-style warning toggles). Recognise the (Clang + SIMULATE_ID=MSVC) combination as the MSVC driver path so the same MSVC-flavoured flag set is applied. Native clang/AppleClang is unaffected because SIMULATE_ID is empty there. Signed-off-by: Nuno Marques <n.marques21@hotmail.com>