[Lldb-commits] [PATCH] D24749: [CMake] Initial support for LLDB.framework

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 20 13:20:02 PDT 2016

labath added inline comments.

Comment at: cmake/modules/AddLLDB.cmake:75
@@ -74,1 +74,3 @@
       if (PARAM_SHARED)
+        set(out_dir lib${LLVM_LIBDIR_SUFFIX})
+        if(${name} STREQUAL "liblldb" AND LLDB_BUILD_FRAMEWORK)
I am wondering whether this wouldn't be cleaner if instead of matching on the library name, we made Framework a top-level concept, like PARAM_SHARED, and PARAM_OBJECT is.

Comment at: cmake/modules/AddLLDB.cmake:115
@@ +114,3 @@
+    else()
+      set_property(TARGET ${name} APPEND_STRING PROPERTY
+                   LINK_FLAGS " -rpath @loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
It  should be possible to achieve this with the `INSTALL_RPATH` target property. I think that is much cleaner. <https://cmake.org/cmake/help/v3.0/prop_tgt/INSTALL_RPATH.html>

Comment at: source/API/CMakeLists.txt:9
@@ -8,1 +8,3 @@
+option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
beanz wrote:
> tfiala wrote:
> > zturner wrote:
> > > Is there any reason to have this off when building on OSX?  Is there any value in having it not be an option at all, but just if you're on Darwin, you just always get a Framework?
> > I mentioned to Chris that I wasn't sure if the Google folks (or maybe Dawn) that build with the CMake build might want to keep it building the old way.
> > 
> > I'd be all for only building only the framework way with CMake if nobody else particularly cared.  That would simplify things.  But I don't want to force it if anybody else cares.
> > 
> > Our goal is to get the CMake-based build producing the same exact thing as our Xcode-based build.
> Since this is new functionality that changes the build system behavior it is always best to leave it optional and off by default so that it can be properly tested and won't impact consumers. For users who don't set `LLDB_BUILD_FRAMEWORK=On` this patch should be NFC.
> Additionally since OS X is Unix it would be undesirable to force OS X to always build a framework because some users may prefer unix-style builds (me being one of them). Whether or not the default build should be a framework I think is a question we can ask ourselves later once this patch is fully tested and after subsequent patches to fix the install targets. 
Thank you for thinking about us Todd. For us, it makes our downstream scripts a bit simpler when the darwin and linux builds produce the same layout, but we're not particularly married to them. If it makes things significantly simpler, we would be fine with dropping it (but please do let us know if you intend to do that).


More information about the lldb-commits mailing list