summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-config/llvm-config.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 53368ff067..8a42aa33cc 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -345,27 +345,29 @@ int main(int argc, char **argv) {
ComputeLibsForComponents(Components, RequiredLibs,
/*IncludeNonInstalled=*/IsInDevelopmentTree);
- for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
- StringRef Lib = RequiredLibs[i];
- if (i)
- OS << ' ';
-
- if (PrintLibNames) {
- OS << Lib;
- } else if (PrintLibFiles) {
- OS << ActiveLibDir << '/' << Lib;
- } else if (PrintLibs) {
- // If this is a typical library name, include it using -l.
- if (Lib.startswith("lib") && Lib.endswith(".a")) {
- OS << "-l" << Lib.slice(3, Lib.size()-2);
- continue;
- }
+ if (PrintLibs || PrintLibNames || PrintLibFiles) {
+ for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
+ StringRef Lib = RequiredLibs[i];
+ if (i)
+ OS << ' ';
- // Otherwise, print the full path.
- OS << ActiveLibDir << '/' << Lib;
+ if (PrintLibNames) {
+ OS << Lib;
+ } else if (PrintLibFiles) {
+ OS << ActiveLibDir << '/' << Lib;
+ } else if (PrintLibs) {
+ // If this is a typical library name, include it using -l.
+ if (Lib.startswith("lib") && Lib.endswith(".a")) {
+ OS << "-l" << Lib.slice(3, Lib.size()-2);
+ continue;
+ }
+
+ // Otherwise, print the full path.
+ OS << ActiveLibDir << '/' << Lib;
+ }
}
+ OS << '\n';
}
- OS << '\n';
// Print SYSTEM_LIBS after --libs.
// FIXME: Each LLVM component may have its dependent system libs.