[clang] [compiler-rt] [llvm] [CMake] Use Clang to infer the target triple (PR #89425)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 23:44:09 PDT 2024


================
@@ -28,6 +28,19 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   if (NOT LLVM_RUNTIMES_BUILD)
     load_llvm_config()
   endif()
+  if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
+    set(print_target_triple ${CMAKE_CXX_COMPILER} --target=${LLVM_RUNTIME_TRIPLE} -print-target-triple)
----------------
petrhosek wrote:

Good point, I changed it to `CMAKE_C_COMPILER`.

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


More information about the cfe-commits mailing list