File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1269,6 +1269,11 @@ std::optional<std::vector<std::string>> ClangImporter::getClangCC1Arguments(
1269
1269
// Clear clang debug flags.
1270
1270
CI->getCodeGenOpts ().DwarfDebugFlags .clear ();
1271
1271
1272
+ // Pass along the VFS overlays
1273
+ for (auto &File : ctx.SearchPathOpts .VFSOverlayFiles ) {
1274
+ CI->getHeaderSearchOpts ().VFSOverlayFiles .push_back (File);
1275
+ }
1276
+
1272
1277
return CI->getCC1CommandLine ();
1273
1278
}
1274
1279
Original file line number Diff line number Diff line change @@ -112,6 +112,14 @@ static std::vector<std::string> getClangDepScanningInvocationArguments(
112
112
commandLineArgs.push_back (" -Xclang" );
113
113
commandLineArgs.push_back (" -finclude-tree-preserve-pch-path" );
114
114
115
+ // Handle VFSOverlay. If include tree is used, there is no need for overlay.
116
+ if (!ctx.ClangImporterOpts .UseClangIncludeTree ) {
117
+ for (auto &overlay : ctx.SearchPathOpts .VFSOverlayFiles ) {
118
+ commandLineArgs.push_back (" -vfsoverlay" );
119
+ commandLineArgs.push_back (overlay);
120
+ }
121
+ }
122
+
115
123
return commandLineArgs;
116
124
}
117
125
@@ -185,6 +193,13 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies(
185
193
swiftArgs.push_back (" -vfsoverlay" );
186
194
swiftArgs.push_back (remapPath (overlay));
187
195
}
196
+
197
+ // Pass along the SDK path
198
+ StringRef SDKPath = ctx.SearchPathOpts .getSDKPath ();
199
+ if (!SDKPath.empty ()) {
200
+ swiftArgs.push_back (" -sdk" );
201
+ swiftArgs.push_back (SDKPath.str ());
202
+ }
188
203
}
189
204
190
205
// Add args reported by the scanner.
Original file line number Diff line number Diff line change
1
+ // RUN: %target-run-simple-swift(-explicit-module-build) | %FileCheck %s
2
+
3
+ // REQUIRES: executable_test
4
+
5
+ print ( " Hello, Explicit Module Build! " )
6
+
7
+ // CHECK: Hello, Explicit Module Build!
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -scan-dependencies -Xcc -v %s -o - | %validate-json | %FileCheck %s
3
+
4
+ // We want to explicitly import WinSDK's CRT.
5
+ // REQUIRES: OS=windows-msvc
6
+
7
+ import CRT
8
+
9
+ // CHECK: "modulePath": "{{.*}}\\ucrt-{{.*}}.pcm",
10
+ // CHECK-NEXT: "sourceFiles": [
11
+ // CHECK-NEXT: "{{.*}}\\ucrt\\module.modulemap"
You can’t perform that action at this time.
0 commit comments