This is an archive of the discontinued LLVM Phabricator instance.

[tools] Only build lldb-instr and lldb-vscode if asked.
ClosedPublic

Authored by davide on Apr 16 2019, 9:20 AM.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

davide created this revision.Apr 16 2019, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2019, 9:20 AM
JDevlieghere requested changes to this revision.Apr 16 2019, 10:23 AM

We need to define these variables in the cache and make sure the test suite knows about them.

For lldb-instr for example, which lives in lit/tools/lldb-instr, you'd have to configure lit.site.cfg.py.in to know about wheter it's enabled or not (for example config.have_lldb_instr) and then check for this configuration variable in the lit.site.cfg in the lldb-instr test dir.

This revision now requires changes to proceed.Apr 16 2019, 10:23 AM
labath added a subscriber: labath.Apr 16 2019, 10:46 AM

LLDB_TOOL_$TOOL_BUILD would be a better name for consistency with llvm. In fact, if we started using the llvm cmake macros like add_llvm_subdirectory, it would handle this automatically, including creating the cache variable.

The only difference would be that the variable would default to "On", whereas you seem to want default-off. (I'm a bit torn on whether this is good. On one hand, I understand the desire to not build this stuff, but on the other, this creates an inconsistency with llvm, which builds everything by default, and consistency is a good thing.)

Also, I'd like to nominate lldb-mi as an additional optional feature. :)

jgorbe added a subscriber: jgorbe.Apr 16 2019, 11:03 AM

LLDB_TOOL_$TOOL_BUILD would be a better name for consistency with llvm. In fact, if we started using the llvm cmake macros like add_llvm_subdirectory, it would handle this automatically, including creating the cache variable.

The only difference would be that the variable would default to "On", whereas you seem to want default-off. (I'm a bit torn on whether this is good. On one hand, I understand the desire to not build this stuff, but on the other, this creates an inconsistency with llvm, which builds everything by default, and consistency is a good thing.)

Also, I'd like to nominate lldb-mi as an additional optional feature. :)

+1 on everything Pavel said. I'd also prefer to keep this on by default.

davide updated this revision to Diff 195443.Apr 16 2019, 1:14 PM

updated.

JDevlieghere added inline comments.Apr 16 2019, 1:19 PM
lldb/cmake/modules/AddLLDB.cmake
145 ↗(On Diff #195443)

Let's drop optional from the name

lldb/lit/lit.site.cfg.py.in
21 ↗(On Diff #195443)

You can use llvm_canonicalize_cmake_booleans to make it a real boolean similar to config.have_zlib

Also, maybe use "have" instead of "has" for consistency?

davide updated this revision to Diff 195454.Apr 16 2019, 1:58 PM

Jonas' comments

davide marked 2 inline comments as done.Apr 16 2019, 1:59 PM
This revision is now accepted and ready to land.Apr 16 2019, 2:01 PM
This revision was automatically updated to reflect the committed changes.