Add a -l flag to Swift and use it to provide autolinking information.

The spelling of the flag can certainly be changed; I just wanted to get
something up and running.

Swift SVN r7582
This commit is contained in:
Jordan Rose
2013-08-26 18:57:48 +00:00
parent 940d53c864
commit 22912bc3b3
7 changed files with 38 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//
#include "swift/AST/Diagnostics.h"
#include "swift/AST/LinkLibrary.h"
#include "swift/AST/Module.h"
#include "swift/AST/ModuleLoader.h"
#include "swift/AST/NameLookup.h"
@@ -535,8 +536,9 @@ void Module::collectLinkLibraries(LinkLibraryCallback callback) {
return true;
}
if (isa<TranslationUnit>(module)) {
// FIXME: Should we include libraries specified by the user here?
if (auto TU = dyn_cast<TranslationUnit>(module)) {
for (auto lib : TU->getLinkLibraries())
callback(lib);
return true;
}