[Lldb-commits] [PATCH] D126557: [lldb] Fix cross compiling on macOS

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 27 10:08:08 PDT 2022


mstorsjo created this revision.
mstorsjo added a reviewer: JDevlieghere.
Herald added a subscriber: mgorny.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLDB.

When cross compiling, a separate nested cmake is spawned, for building
host code generation tools such as lldb-tblgen.

When cross compiling on macOS, the nested native build would trigger
the lldb check for libc++, if testing is enabled (which it is by default).
(Even if `LLDB_INCLUDE_TESTS=OFF` is set on the main build, it has to
be passed separately in `CROSS_TOOLCHAIN_FLAGS_NATIVE` to reach the
nested build.)

Skip this check when building the host tools when cross compiling, as
the user won't try to run tests in that nested build.

Alternatively, we could consider disabling all the `*_INCLUDE_TESTS`
by default in the nested host tools build.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126557

Files:
  lldb/test/CMakeLists.txt


Index: lldb/test/CMakeLists.txt
===================================================================
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -103,7 +103,7 @@
     add_lldb_test_dependency(tsan)
   endif()
 
-  if(APPLE)
+  if(APPLE AND NOT LLVM_TARGET_IS_CROSSCOMPILE_HOST)
     # FIXME: Standalone builds should import the cxx target as well.
     if(LLDB_BUILT_STANDALONE)
       # For now check that the include directory exists.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126557.432596.patch
Type: text/x-patch
Size: 453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220527/91512338/attachment.bin>


More information about the lldb-commits mailing list