This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Include gtest in standalone build only if LLDB_INCLUDE_TESTS
ClosedPublic

Authored by mgorny on Oct 23 2022, 5:49 AM.

Details

Summary

Build gtest targets when building standalone only if LLDB_INCLUDE_TESTS
is true. Prior to this change, they were built whenever
LLVM_MAIN_SRC_DIR was available, independently whether tests themselves
would be run.

Diff Detail

Event Timeline

mgorny created this revision.Oct 23 2022, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 5:49 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
mgorny requested review of this revision.Oct 23 2022, 5:49 AM
mgorny added inline comments.
lldb/CMakeLists.txt
20

To be honest, I don't exactly like moving this option. The alternative I can think of is moving gtest and LLVMTestingSupport logic from LLDBStandalone into unittests.

labath added inline comments.Oct 24 2022, 1:43 AM
lldb/CMakeLists.txt
20

So, how does this work in non-standalone builds? Is gtest built unconditionally, or is it guarded by something else (LLVM_INCLUDE_TESTS perhaps?)

mgorny added inline comments.Oct 24 2022, 3:17 AM
lldb/CMakeLists.txt
20

It's guarded by LLVM_INCLUDE_UTILS + LLVM_INCLUDE_TESTS.

labath added inline comments.Oct 24 2022, 5:39 AM
lldb/CMakeLists.txt
20

Ok, I think that's fine. I'm not particularly upset by that. Doing this work in the unittest directory would probably be fine too...

labath accepted this revision.Oct 24 2022, 5:39 AM
This revision is now accepted and ready to land.Oct 24 2022, 5:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 6:52 AM