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 @@ -1747,7 +1747,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
17471747 // If the compiler has been asked to be strict with ensuring downstream dependencies
17481748 // get the parent invocation's context, or this is an Explicit build, inherit the
17491749 // extra Clang arguments also.
1750- if (LoaderOpts.strictImplicitModuleContext || LoaderOpts.disableImplicitSwiftModule ) {
1750+ if (LoaderOpts.strictImplicitModuleContext || LoaderOpts.disableImplicitSwiftModule ||
1751+ LoaderOpts.requestedAction == FrontendOptions::ActionType::ScanDependencies) {
17511752 // Inherit any clang-specific state of the compilation (macros, clang flags, etc.)
17521753 subClangImporterOpts.ExtraArgs = clangImporterOpts.ExtraArgs ;
17531754 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