llvm.org GIT mirror llvm / 7bc65d0
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202719 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Osborne 5 years ago
1 changed file(s) with 21 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
344344 ComputeLibsForComponents(Components, RequiredLibs,
345345 /*IncludeNonInstalled=*/IsInDevelopmentTree);
346346
347 for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
348 StringRef Lib = RequiredLibs[i];
349 if (i)
350 OS << ' ';
351
352 if (PrintLibNames) {
353 OS << Lib;
354 } else if (PrintLibFiles) {
355 OS << ActiveLibDir << '/' << Lib;
356 } else if (PrintLibs) {
357 // If this is a typical library name, include it using -l.
358 if (Lib.startswith("lib") && Lib.endswith(".a")) {
359 OS << "-l" << Lib.slice(3, Lib.size()-2);
360 continue;
347 if (PrintLibs || PrintLibNames || PrintLibFiles) {
348 for (unsigned i = 0, e = RequiredLibs.size(); i != e; ++i) {
349 StringRef Lib = RequiredLibs[i];
350 if (i)
351 OS << ' ';
352
353 if (PrintLibNames) {
354 OS << Lib;
355 } else if (PrintLibFiles) {
356 OS << ActiveLibDir << '/' << Lib;
357 } else if (PrintLibs) {
358 // If this is a typical library name, include it using -l.
359 if (Lib.startswith("lib") && Lib.endswith(".a")) {
360 OS << "-l" << Lib.slice(3, Lib.size()-2);
361 continue;
362 }
363
364 // Otherwise, print the full path.
365 OS << ActiveLibDir << '/' << Lib;
361366 }
362
363 // Otherwise, print the full path.
364 OS << ActiveLibDir << '/' << Lib;
365367 }
366 }
367 OS << '\n';
368 OS << '\n';
369 }
368370
369371 // Print SYSTEM_LIBS after --libs.
370372 // FIXME: Each LLVM component may have its dependent system libs.