[runtimes] Initialize LLVM_DEFAULT_TARGET_TRIPLE if not set by the caller
authorMartin Storsjö <martin@martin.st>
Mon, 13 Sep 2021 19:27:17 +0000 (22:27 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 14 Sep 2021 08:04:23 +0000 (11:04 +0300)
Differential Revision: https://reviews.llvm.org/D109716

runtimes/CMakeLists.txt

index b88aa46..350c9c1 100644 (file)
@@ -104,6 +104,11 @@ include(HandleLLVMOptions)
 
 find_package(Python3 REQUIRED COMPONENTS Interpreter)
 
+if (NOT LLVM_DEFAULT_TARGET_TRIPLE)
+  include(GetHostTriple)
+  get_host_triple(LLVM_DEFAULT_TARGET_TRIPLE)
+endif()
+
 # Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
 if(CMAKE_HOST_APPLE AND APPLE)
   include(UseLibtool)