Skip to content

Commit f33deef

Browse files
committed
[swift-refactor] Support -I and -sdk
1 parent 39cc1cb commit f33deef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/swift-refactor/swift-refactor.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ static llvm::cl::opt<bool> EnableExperimentalConcurrency(
124124
"enable-experimental-concurrency",
125125
llvm::cl::desc("Whether to enable experimental concurrency or not"));
126126

127+
static llvm::cl::opt<std::string>
128+
SDK("sdk", llvm::cl::desc("Path to the SDK to build against"));
129+
130+
static llvm::cl::list<std::string>
131+
ImportPaths("I",
132+
llvm::cl::desc("Add a directory to the import search path"));
133+
127134
enum class DumpType {
128135
REWRITTEN,
129136
JSON,
@@ -274,6 +281,10 @@ int main(int argc, char *argv[]) {
274281
Invocation.setMainExecutablePath(
275282
llvm::sys::fs::getMainExecutable(argv[0],
276283
reinterpret_cast<void *>(&anchorForGetMainExecutable)));
284+
285+
Invocation.setSDKPath(options::SDK);
286+
Invocation.setImportSearchPaths(options::ImportPaths);
287+
277288
Invocation.getFrontendOptions().InputsAndOutputs.addInputFile(
278289
options::SourceFilename);
279290
Invocation.getLangOptions().AttachCommentsToDecls = true;

0 commit comments

Comments
 (0)