[PATCH] D11835: Make `llvm-config` work when static versions of LLVM's components aren't installed.

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 10:57:39 PDT 2015


beanz added a subscriber: beanz.
beanz added a comment.

In general I think this patch is moving in the right direction. Eventually we'll need to add better support for working with the CMake-generated shared library. In particular because LLVM_DYLIB_COMPONENTS can be modified to control what LLVM libraries end up in the dylib you can reasonably end up in a position where an llvm-config command might need to return a mix of static and shared libraries.

My plan had been at some point to bake this into the CMake scripts and have that be installed, but we will need that support in llvm-config at some point too.


================
Comment at: tools/llvm-config/llvm-config.cpp:380
@@ +379,3 @@
+      // static libraries) for obvious reasons, but I thought it should be
+      // documented nonetheless.
+      const bool BuiltWithSharedLib = (std::strcmp(LLVM_ENABLE_SHARED, "ON") == 0);
----------------
LLVM_DYLIB_COMPONENTS doesn't need to be a cached value, and I don't think it should be. The only benefit to making it a cached value would be that it would show up in ccmake and the CMake GUI, but it brings downsides because there is no cache invalidation in CMake. If you override it on the command line the overridden value will end up in the cache, so there is no requirement for this to be cached. With it not being in the cache, if the default value changes it will update everyone's build directories, which should work without issue.


Repository:
  rL LLVM

http://reviews.llvm.org/D11835





More information about the llvm-commits mailing list