[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:13:06 PST 2024


================
@@ -2,7 +2,7 @@
 # Invokes config.guess
 
 function( get_host_triple var )
-  if( MSVC )
+  if( MSVC OR (CMAKE_SYSTEM_NAME STREQUAL Windows AND CMAKE_C_COMPILER_ID MATCHES "Clang"))
----------------
mstorsjo wrote:

Sorry, I realized that this doesn't quite work as wanted either. This will also match this case for clang in mingw mode, where CMake doesn't set `CMAKE_C_COMPILER_ARCHITECTURE_ID` at all.

If you add an `AND NOT MINGW` at the end within the parentheses, this should do the right thing.

(Also, does the `STREQUAL` with `Windows` without quotes work? I would have intuitively written this as `... STREQUAL "Windows"`, but perhaps it works without them as well?)

https://github.com/llvm/llvm-project/pull/116701


More information about the llvm-commits mailing list