[Lldb-commits] [lldb] 9191078 - [lldb] Fix cross compiling on macOS

Martin Storsjö via lldb-commits lldb-commits at lists.llvm.org
Fri May 27 14:53:42 PDT 2022


Author: Martin Storsjö
Date: 2022-05-28T00:53:25+03:00
New Revision: 9191078707390c32b691ff84633ab9450b380ea5

URL: https://github.com/llvm/llvm-project/commit/9191078707390c32b691ff84633ab9450b380ea5
DIFF: https://github.com/llvm/llvm-project/commit/9191078707390c32b691ff84633ab9450b380ea5.diff

LOG: [lldb] Fix cross compiling on macOS

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.)

Differential Revision: https://reviews.llvm.org/D126557

Added: 
    

Modified: 
    lldb/test/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 7a55bf47b5d34..e23ac6651a557 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -103,7 +103,7 @@ if(TARGET clang)
     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.


        


More information about the lldb-commits mailing list