@@ -38,6 +38,10 @@ static llvm::cl::list<std::string>
38
38
FrameworkSearchPaths (" F" , llvm::cl::desc(" Add a directory to the framework search paths" ), llvm::cl::ZeroOrMore,
39
39
llvm::cl::cat(Category));
40
40
41
+ static llvm::cl::list<std::string>
42
+ SystemFrameworkSearchPaths (" Fsystem" , llvm::cl::desc(" Add directory to system framework search path" ), llvm::cl::ZeroOrMore,
43
+ llvm::cl::cat(Category));
44
+
41
45
static llvm::cl::list<std::string>
42
46
LibrarySearchPaths (" L" , llvm::cl::desc(" Add a directory to the library search paths" ), llvm::cl::ZeroOrMore,
43
47
llvm::cl::cat(Category));
@@ -75,6 +79,11 @@ static llvm::cl::list<std::string>
75
79
Xcc (" Xcc" , llvm::cl::desc(" Pass the following command-line flag to Clang" ),
76
80
llvm::cl::cat(Category));
77
81
82
+ static llvm::cl::opt<std::string>
83
+ ResourceDir (" resource-dir" ,
84
+ llvm::cl::desc (" Override the directory that holds the compiler resource files" ),
85
+ llvm::cl::cat(Category));
86
+
78
87
static llvm::cl::opt<std::string>
79
88
OutputDir (" output-dir" , llvm::cl::desc(" Symbol Graph JSON Output Directory (Required)" ), llvm::cl::cat(Category));
80
89
} // end namespace options
@@ -132,6 +141,9 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
132
141
Invocation.setMainExecutablePath (
133
142
llvm::sys::fs::getMainExecutable (Argv0, MainAddr));
134
143
Invocation.setModuleName (" swift_symbolgraph_extract" );
144
+ if (!options::ResourceDir.empty ()) {
145
+ Invocation.setRuntimeResourcePath (options::ResourceDir);
146
+ }
135
147
Invocation.setSDKPath (options::SDK);
136
148
Invocation.setTargetTriple (options::Target);
137
149
@@ -143,6 +155,9 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
143
155
for (const auto &Path : options::FrameworkSearchPaths) {
144
156
FrameworkSearchPaths.push_back ({ Path, /* isSystem*/ false });
145
157
}
158
+ for (const auto &Path : options::SystemFrameworkSearchPaths) {
159
+ FrameworkSearchPaths.push_back ({ Path, /* isSystem*/ true });
160
+ }
146
161
Invocation.setFrameworkSearchPaths (FrameworkSearchPaths);
147
162
Invocation.getSearchPathOptions ().LibrarySearchPaths = options::LibrarySearchPaths;
148
163
Invocation.setImportSearchPaths (options::ImportSearchPaths);
@@ -154,6 +169,7 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args, const char *Argv
154
169
155
170
Invocation.setClangModuleCachePath (options::ModuleCachePath);
156
171
Invocation.getClangImporterOptions ().ModuleCachePath = options::ModuleCachePath;
172
+ Invocation.setDefaultPrebuiltCacheIfNecessary ();
157
173
158
174
if (!options::SwiftVersion.empty ()) {
159
175
using version::Version;
0 commit comments