This is an archive of the discontinued LLVM Phabricator instance.

[lldb][cmake] Allow specifying custom libcxx for tests in standalone builds
ClosedPublic

Authored by Michael137 on May 19 2023, 3:16 AM.

Details

Summary

Standalone builds currently do not set the LLDB_HAS_LIBCXX,
LIBCXX_LIBRARY_DIR, LIBCXX_GENERATED_INCLUDE_DIR.
These are necessary for API tests with USE_LIBCPP to run against
a custom built libcxx. Thus on all buildbots using standalone builds
(most notably the public swift-ci), the API tests always run against
the libcxx headers in the system SDK.

This patch introduces a new cmake variable LLDB_TEST_LIBCXX_ROOT_DIR
that allows us to point the tests in standalone builds to a custom
libcxx directory.

Since the user can control the libcxx location we can hard error if
no such custom libcxx build exists.

Diff Detail

Event Timeline

Michael137 created this revision.May 19 2023, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 3:16 AM
Herald added a subscriber: ekilmer. · View Herald Transcript
Michael137 requested review of this revision.May 19 2023, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 3:16 AM

Outstanding question would be whether we want to mirror this change in utils/lldb-dotest/CMakeLists.txt. If so, we should probably extract all this libcxx logic into a common helper between the two.

JDevlieghere added inline comments.May 19 2023, 8:16 AM
lldb/test/CMakeLists.txt
142–143

If this is only necessary for the standalone build, then this should go in cmake/modules/LLDBStandalone.cmake.

  • Move variable into LLDBStandalone.cmake
Michael137 marked an inline comment as done.May 19 2023, 9:04 AM
aprantl accepted this revision.May 19 2023, 9:08 AM
This revision is now accepted and ready to land.May 19 2023, 9:08 AM