This is an archive of the discontinued LLVM Phabricator instance.

lldb: Disable unittests if llvm_gtest target does not exist
ClosedPublic

Authored by tstellar on Apr 22 2022, 5:59 PM.

Details

Summary

This fixes the stand-alone build configuration where LLVM_MAIN_SRC_DIR
does not exist.

Diff Detail

Event Timeline

tstellar created this revision.Apr 22 2022, 5:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 5:59 PM
Herald added a subscriber: mgorny. · View Herald Transcript
tstellar requested review of this revision.Apr 22 2022, 5:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 5:59 PM

Could this go in LLDBStandalone.cmake?

tstellar updated this revision to Diff 449880.Aug 3 2022, 10:55 PM

Move new logic to LLDBStandalone.cmake

This revision is now accepted and ready to land.Aug 4 2022, 9:08 AM
mgorny reopened this revision.Aug 13 2022, 5:25 AM

Unfortunately, this change doesn't work correctly when building LLDB through LLVM_ENABLE_PROJECTS — unittests are always disabled now.

lldb/CMakeLists.txt
128 ↗(On Diff #451684)

If LLDB is built through LLVM_ENABLE_PROJECTS, then LLDB's CMakeLists are included before the subdirectory containing llvm_gtest, effectively making this condition always false.

This revision is now accepted and ready to land.Aug 13 2022, 5:25 AM
JDevlieghere added inline comments.Aug 14 2022, 9:38 AM
lldb/CMakeLists.txt
128 ↗(On Diff #451684)

Good catch. I've put up https://reviews.llvm.org/D131861 as a (straw man) proposal. But I haven't tested it yet.

Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2022, 9:54 AM