File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -1756,7 +1756,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
1756
1756
// If the compiler has been asked to be strict with ensuring downstream dependencies
1757
1757
// get the parent invocation's context, or this is an Explicit build, inherit the
1758
1758
// extra Clang arguments also.
1759
- if (LoaderOpts.strictImplicitModuleContext || LoaderOpts.disableImplicitSwiftModule ) {
1759
+ if (LoaderOpts.strictImplicitModuleContext || LoaderOpts.disableImplicitSwiftModule ||
1760
+ LoaderOpts.requestedAction == FrontendOptions::ActionType::ScanDependencies) {
1760
1761
// Inherit any clang-specific state of the compilation (macros, clang flags, etc.)
1761
1762
subClangImporterOpts.ExtraArgs = clangImporterOpts.ExtraArgs ;
1762
1763
for (auto arg : subClangImporterOpts.ExtraArgs ) {
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %empty-directory(%t/clang-module-cache)
3
+
4
+ // RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -Xcc -fobjc-disable-direct-methods-for-testing
5
+ // Check the contents of the JSON output
6
+ // RUN: %validate-json %t/deps.json | %FileCheck %s
7
+
8
+ // REQUIRES: executable_test
9
+ // REQUIRES: objc_interop
10
+
11
+ import C
12
+
13
+ // CHECK: "mainModuleName": "deps"
14
+ /// --------Main module
15
+ // CHECK-LABEL: "modulePath": "deps.swiftmodule",
16
+ // CHECK-NEXT: sourceFiles
17
+ // CHECK-NEXT: ObjCStrict.swift
18
+ // CHECK-NEXT: ],
19
+ // CHECK-NEXT: "directDependencies": [
20
+ // CHECK-DAG: "clang": "C"
21
+ // CHECK-DAG: "swift": "Swift"
22
+ // CHECK-DAG: "swift": "SwiftOnoneSupport"
23
+ // CHECK-DAG: "swift": "_Concurrency"
24
+ // CHECK: ],
25
+
26
+ // CHECK: "swift": "A"
27
+ // CHECK: "swift": {
28
+ // CHECK-NEXT: "moduleInterfacePath": "{{.*}}{{/|\\}}Inputs{{/|\\}}Swift{{/|\\}}A.swiftinterface",
29
+ // CHECK: "commandLine": [
30
+ // CHECK: "-fobjc-disable-direct-methods-for-testing"
31
+ // CHECK: "-o",
32
+ // CHECK-NEXT: "{{.*}}{{/|\\}}A-{{.*}}.swiftmodule",
33
+
34
+
35
+
You can’t perform that action at this time.
0 commit comments