isuruf created this revision.
Herald added subscribers: cfe-commits, mgorny.
Herald added a project: clang.
isuruf requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85562

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -115,6 +115,16 @@
   option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)
 
   include(AddLLVM)
+  if(CMAKE_CROSSCOMPILING)
+    set(LLVM_USE_HOST_TOOLS ON)
+    include(CrossCompile)
+    if (NOT NATIVE_LLVM_DIR)
+      message(FATAL_ERROR
+       "Crosscompiling standalone requires the variable NATIVE_LLVM_DIR
+       for building the native clang-tblgen used during the build process.")
+    endif()
+    llvm_create_cross_target(Clang NATIVE "" Release 
-DLLVM_DIR=${NATIVE_LLVM_DIR})
+  endif()
   include(TableGen)
   include(HandleLLVMOptions)
   include(VersionFromVCS)


Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -115,6 +115,16 @@
   option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)
 
   include(AddLLVM)
+  if(CMAKE_CROSSCOMPILING)
+    set(LLVM_USE_HOST_TOOLS ON)
+    include(CrossCompile)
+    if (NOT NATIVE_LLVM_DIR)
+      message(FATAL_ERROR
+       "Crosscompiling standalone requires the variable NATIVE_LLVM_DIR
+       for building the native clang-tblgen used during the build process.")
+    endif()
+    llvm_create_cross_target(Clang NATIVE "" Release -DLLVM_DIR=${NATIVE_LLVM_DIR})
+  endif()
   include(TableGen)
   include(HandleLLVMOptions)
   include(VersionFromVCS)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to