The following only applies if the following is true:
- llvm-config isn't inside the build tree (ie it's installed).
- LLVM is built with shared libs (via --enable-shared or LLVM_BUILD_LLVM_DYLIB) enabled.
- llvm-config finds the platform specific shared library file in the 'lib' subfolder within the install root (ie it finds 'libLLVM-3.7.0svn.so' or 'libLLVM.so.3.7.0svn' on Linux).
If llvm-config, when visiting all the components, finds a missing
archive, it will override the set of RequiredLibs to only include
that shared library. Note that this means that if one has installed
only select libraries in static form and component X and it's deps are
among them, --libname X will still print static archive names. I
wouldn't recommend doing that (installing shared library + only some
static libraries) for obvious reasons, but I thought it should be
documented nonetheless.
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
and then the logic here can just use #ifdef. Or, one could configure another variable that is known to be set as desired: