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

Brad King via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 12:42:55 PDT 2015


brad.king 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;
----------------
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()




http://reviews.llvm.org/D11835





More information about the llvm-commits mailing list