[Lldb-commits] [lldb] r366392 - [cmake] Add NATIVE build for cross compiling standalone builds

Nathan Lanza via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 17 17:21:57 PDT 2019


Author: lanza
Date: Wed Jul 17 17:21:57 2019
New Revision: 366392

URL: http://llvm.org/viewvc/llvm-project?rev=366392&view=rev
Log:
[cmake] Add NATIVE build for cross compiling standalone builds

TableGen is a host tool and requires a native variant for every build.
While building as a part of llvm this is trivial and llvm handles it.
However, building standalone means that lldb has to handle this itself.
Add a NATIVE build variant to enable this.

Modified:
    lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=366392&r1=366391&r2=366392&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Wed Jul 17 17:21:57 2019
@@ -39,6 +39,20 @@ if (NOT LLDB_DISABLE_PYTHON)
   add_subdirectory(scripts)
 endif ()
 
+if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE)
+  set(LLVM_USE_HOST_TOOLS ON)
+  include(CrossCompile)
+  if (NOT LLDB_PATH_TO_NATIVE_LLVM_BUILD OR
+      NOT LLDB_PATH_TO_NATIVE_CLANG_BUILD)
+    message(FATAL_ERROR
+      "Crosscompiling standalone requires the variables LLDB_PATH_TO_NATIVE_{CLANG,LLVM}_BUILD
+      for building the native lldb-tblgen used during the build process.")
+  endif()
+  llvm_create_cross_target(lldb NATIVE "" Release
+    -DLLDB_PATH_TO_LLVM_BUILD=${LLDB_PATH_TO_NATIVE_LLVM_BUILD}
+    -DLLDB_PATH_TO_CLANG_BUILD=${LLDB_PATH_TO_NATIVE_CLANG_BUILD})
+endif()
+
 add_subdirectory(utils/TableGen)
 add_subdirectory(source)
 add_subdirectory(tools)




More information about the lldb-commits mailing list