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

Richard Diamond via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 16:01:37 PDT 2015


DiamondLovesYou added inline comments.

================
Comment at: tools/llvm-config/llvm-config.cpp:380
@@ +379,3 @@
+      // documented nonetheless.
+      const bool BuiltWithSharedLib = (std::strcmp(BUILD_SHARED_LIBS, "ON") == 0);
+      std::string SharedLibName = "libLLVM-" PACKAGE_VERSION;
----------------
brad.king wrote:
> When building with CMake the value of `BUILD_SHARED_LIBS` may have "true" values other than `ON`.  The value could be configured in the header file with
> 
>     #cmakedefine BUILD_SHARED_LIBS
> 
> and then the logic here can just use `#ifdef`.  Or, one could configure another variable that is known to be set as desired:
> 
>     if(BUILD_SHARED_LIBS)
>       set(LLVM_ENABLE_SHARED ON)
>     else()
>       set(LLVM_ENABLE_SHARED OFF)
>     endif()
> 
> 
But doesn't CMake build separate shared libraries for each component? Meaning `libLLVM-3.7.0svn.so` wouldn't exist, meaning `llvm-config` would still use the old behavior? Please correct me if I'm wrong.


http://reviews.llvm.org/D11835





More information about the llvm-commits mailing list