This is an archive of the discontinued LLVM Phabricator instance.

build: add libedit to include paths
ClosedPublic

Authored by tatyana-krasnukha on Sep 12 2018, 12:38 PM.

Details

Summary

Without that build of Host, Core and Interpreter with custom libedit fails.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

davide added a subscriber: davide.Sep 12 2018, 12:43 PM

How exactly are you building (i.e. what triggers this error)?

Everything that includes Host/Editline.h (Host/Editline.cpp, Core/IOHandler.cpp, ...). Build fails with "fatal error: histedit.h: No such file or directory"

TBC, I pass libedit_INCLUDE_DIRS and libedit_LIBRARIES manually to CMake.

compnerd requested changes to this revision.Sep 18 2018, 3:28 PM

Can you use target_include_directories instead and do this only on lldbHost instead please? That restricts the inclusion to just that target, which would help prevent accidental inclusion of the headers. That is the change should be to source/Host/CMakeLists.txt.

This revision now requires changes to proceed.Sep 18 2018, 3:28 PM

Unfortunately, doing this only on lldbHost is not enough, because CMake doesn't propagate include directories to dependent projects. I added these lines to every project that includes "Editline.h".

It definitely shouldn't be PUBLIC, PRIVATE makes sense for this inclusion. Is there a library that pulls in the dependency (that is, do the other libraries need it due to lldbHost? If so, just adding it as INTERFACE on that library should be sufficient).

LLDB's static libraries link each other as INTERFACE, that's why CMake doesn't propagate lldbHost's include directories to lldbCore and lldbInterpreter.
For lldbHost itself, I had to use PUBLIC, because its sources require includes libedit headers and unittests inherit this path too.

compnerd accepted this revision.Sep 21 2018, 11:28 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 21 2018, 11:28 AM
This revision was automatically updated to reflect the committed changes.