Skip to content

Commit 2354929

Browse files
committed
[swift-ide-test / swift-api-dump.py] Add -iframework support.
1 parent 69d6709 commit 2354929

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ ImportPaths("I", llvm::cl::desc("add a directory to the import search path"));
246246
static llvm::cl::list<std::string>
247247
FrameworkPaths("F", llvm::cl::desc("add a directory to the framework search path"));
248248

249+
static llvm::cl::list<std::string>
250+
SystemFrameworkPaths("iframework", llvm::cl::desc("add a directory to the system framework search path"));
251+
249252
static llvm::cl::opt<std::string>
250253
ResourceDir("resource-dir",
251254
llvm::cl::desc("The directory that holds the compiler resource files"));
@@ -2783,6 +2786,11 @@ int main(int argc, char *argv[]) {
27832786
options::ModuleCachePath;
27842787
InitInvok.setImportSearchPaths(options::ImportPaths);
27852788
InitInvok.setFrameworkSearchPaths(options::FrameworkPaths);
2789+
for (const auto &systemFrameworkPath : options::SystemFrameworkPaths) {
2790+
auto &extraArgs = InitInvok.getClangImporterOptions().ExtraArgs;
2791+
extraArgs.push_back("-iframework");
2792+
extraArgs.push_back(systemFrameworkPath);
2793+
}
27862794
InitInvok.getFrontendOptions().EnableSourceImport |=
27872795
options::EnableSourceImport;
27882796
InitInvok.getFrontendOptions().ImplicitObjCHeaderPath =

utils/swift-api-dump.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def create_parser():
9393
help='Print extra information.')
9494
parser.add_argument('-F', '--framework-dir', action='append',
9595
help='Add additional framework directories')
96+
parser.add_argument('-iframework', '--system-framework-dir', action='append',
97+
help='Add additional system framework directories')
9698
parser.add_argument('-I', '--include-dir', action='append',
9799
help='Add additional include directories')
98100
parser.add_argument('--enable-infer-import-as-member', action='store_true',
@@ -282,10 +284,13 @@ def main():
282284
'-skip-overrides'
283285
]
284286

285-
# Add -F / -I arguments.
287+
# Add -F / -iframework / -I arguments.
286288
if args.framework_dir:
287289
for path in args.framework_dir:
288290
cmd_common = cmd_common + ['-F', path]
291+
if args.system_framework_dir:
292+
for path in args.system_framework_dir:
293+
cmd_common = cmd_common + ['-iframework', path]
289294
if args.include_dir:
290295
for path in args.include_dir:
291296
cmd_common = cmd_common + ['-I', path]

0 commit comments

Comments
 (0)