diff options
author | Richard Osborne <richard@xmos.com> | 2014-03-03 15:06:14 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2014-03-03 15:06:14 +0000 |
commit | 49ae117757252a552f821dfa6ff42163428d9f39 (patch) | |
tree | 53bd30701b06a976d32d8caf5bc6758a7b9fb24c /llvm/tools/llvm-config/llvm-config.cpp | |
parent | aa954d1188c6c785f71c36672c40719b40cc3599 (diff) | |
download | bcm5719-llvm-49ae117757252a552f821dfa6ff42163428d9f39.tar.gz bcm5719-llvm-49ae117757252a552f821dfa6ff42163428d9f39.zip |
Don't emit a blank line when running llvm-config --system-libs.
Summary:
Previously llvm-config --system-libs would print something like:
$ llvm-config --system-libs
-lz -ltinfo -lrt -ldl -lm
Now we don't emit blank line. Functionality is unchanged otherwise, in
particular llvm-config --libs --system-libs still emits the LLVM libraries
and the system libraries on different lines.
Reviewers: chapuni
Reviewed By: chapuni
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2901
llvm-svn: 202719
Diffstat (limited to 'llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r-- | llvm/tools/llvm-config/llvm-config.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp index 53368ff067e..8a42aa33cc1 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/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. |