This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix cross compiling on macOS
ClosedPublic

Authored by mstorsjo on May 27 2022, 10:08 AM.

Details

Summary

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.

Diff Detail

Event Timeline

mstorsjo created this revision.May 27 2022, 10:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2022, 10:08 AM
Herald added a subscriber: mgorny. · View Herald Transcript
mstorsjo requested review of this revision.May 27 2022, 10:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2022, 10:08 AM
JDevlieghere accepted this revision.May 27 2022, 10:27 AM

Thank you! LGTM.

This revision is now accepted and ready to land.May 27 2022, 10:27 AM
This revision was automatically updated to reflect the committed changes.