[lldb-dev] [OS X]: building lldb with cmake

René J.V. Bertin via lldb-dev lldb-dev at lists.llvm.org
Fri Sep 9 01:55:06 PDT 2016


Hi,

I've been working on a MacPorts port for lldb (MacPorts already provides ports for llvm and clang; cf. https://trac.macports.org/ticket/45251). Using the Xcode project isn't really an option here, so I've based my approach on the instructions for building using CMake on *n*x. 

In short:

- unpack llvm sources
- unpack lldb sources in the expected location in the llvm tree
- call cmake from an out-of-tree build directory pointing it to the toplevel CMakeLists.txt (i.e. the one in llvm-src)
- call make in the lldb subdir under the build directory (build/tools/lldb).

The nice thing with CMake's Makefiles generator is that it is usually able to figure out what needs to be built from upstreams when make is called in a project subdirectory, and this works with lldb.

Yet I've been asked to look into the possibility of building *just* lldb, using whatever dependencies it requires from the already installed llvm+clang directory.

I'm presuming that there might be a benefit to that approach on other Unices too. Has anyone tried whether this is the case, assuming that it's actually possible?

NB: MacPorts' port:lldb will depend on port:llvm and port:clang, so prebuilt dependencies will be available, as long as nothing is required that is omitted from a standard install.

Thanks,
René


More information about the lldb-dev mailing list