Files
PX4-Autopilot/cmake
Nuno Marques ce12bbaefd build(cmake): treat clang-cl like MSVC in px4_add_common_flags
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>
2026-05-07 18:05:59 -07:00
..