at 17.09-beta 26 lines 1.0 kB view raw
1diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 2index 94d426b..37f7794 100644 3--- a/tools/llvm-config/llvm-config.cpp 4+++ b/tools/llvm-config/llvm-config.cpp 5@@ -333,6 +333,21 @@ int main(int argc, char **argv) { 6 ActiveIncludeOption = "-I" + ActiveIncludeDir; 7 } 8 9+ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared 10+ if (!IsInDevelopmentTree) { 11+ bool WantShared = true; 12+ for (int i = 1; i < argc; ++i) { 13+ StringRef Arg = argv[i]; 14+ if (Arg == "--link-shared") 15+ WantShared = true; 16+ else if (Arg == "--link-static") 17+ WantShared = false; // the last one wins 18+ } 19+ 20+ if (WantShared) 21+ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX; 22+ } 23+ 24 /// We only use `shared library` mode in cases where the static library form 25 /// of the components provided are not available; note however that this is 26 /// skipped if we're run from within the build dir. However, once installed,