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

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Fri Sep 9 10:34:37 PDT 2016


The biggest issue with trying to use cmake on macOS is that there is no support for building frameworks, please correct me if I am wrong. The xcode build will build a "LLDB.framework" that contains all headers and the shared library, and the "lldb" command line tool that links against that. We really want the LLDB.framework since it gives us a bundle like directory that contains everything we need. Current the LLDB.framework contains:
- LLDB headers
- clang headers needed for expression compilation where the compiler parses modules
- associated binaries needed for debugging (lldb-server, lldb-argdumper, debugserver, darwin-debug
- Python module and packages
- XPC services for debugging as root

I believe the normal cmake build just will build a lldb.dylib or lldb.so instead of a LLDB.framework. Then you would need to find a place for all of the remaining stuff just like you have to do on linux. 

With MacPorts, do all projects tend to not build frameworks, or do some build frameworks?

Greg Clayton
> On Sep 9, 2016, at 1:55 AM, René J.V. Bertin via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> 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é
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list