[llvm] Add clang in MSVC mode to GetHostTriple (PR #116701)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 13:12:08 PST 2024
mstorsjo wrote:
The commit message still reads very very weirdly to me - it talks a lot about goals and other stuff, instead of focusing on the actual CMake configuration. (All the other aspects on what tools are available and which sets of tests pass in this configuration, are entirely unrelated to this change.)
May I suggest this instead, which focues on the thing at hand?
---
Subject: [CMake] Handle clang in MSVC mode in GetHostTriple
When configuring CMake with Clang in MSVC mode, Clang can either be invoked with the MSVC style driver (clang-cl) or the GNU style driver (clang). When using the MSVC style driver, CMake sets the CMake variable `MSVC` (which indicates the kind of command line interface), but when using the GNU style driver, this variable isn't set, while Clang still operates in MSVC mode.
Even though CMake doesn't set the variable `MSVC`, it still does set `CMAKE_C_COMPILER_ARCHITECTURE_ID`, which it does set for MSVC and Clang in MSVC mode, but not for Clang in MinGW mode.
For this configuration, use the MSVC style, `CMAKE_C_COMPILER_ARCHITECTURE_ID` based GetHostTriple implementation.
---
Doesn't that capture the thing that this patch actually deals with? If I read the code correctly, `GetHostTriple` would fail in the same way also on x86, if CMake is invoked with Clang in MSVC mode, with the GNU style driver?
https://github.com/llvm/llvm-project/pull/116701
More information about the llvm-commits
mailing list