mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[swift-refactor] Add the option -resource-dir.
This lets one customize in the compiler invocation where the compiler looks for the stdlib. This is necessary if the toolchain is not using a stdlib installed with it.
This commit is contained in:
@@ -138,6 +138,10 @@ static llvm::cl::list<std::string>
|
||||
static llvm::cl::opt<std::string>
|
||||
Triple("target", llvm::cl::desc("target triple"));
|
||||
|
||||
static llvm::cl::opt<std::string> ResourceDir(
|
||||
"resource-dir",
|
||||
llvm::cl::desc("The directory that holds the compiler resource files"));
|
||||
|
||||
enum class DumpType {
|
||||
REWRITTEN,
|
||||
JSON,
|
||||
@@ -294,6 +298,9 @@ int main(int argc, char *argv[]) {
|
||||
if (!options::Triple.empty())
|
||||
Invocation.setTargetTriple(options::Triple);
|
||||
|
||||
if (!options::ResourceDir.empty())
|
||||
Invocation.setRuntimeResourcePath(options::ResourceDir);
|
||||
|
||||
Invocation.getFrontendOptions().InputsAndOutputs.addInputFile(
|
||||
options::SourceFilename);
|
||||
Invocation.getLangOptions().AttachCommentsToDecls = true;
|
||||
|
||||
Reference in New Issue
Block a user