Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Frontend/ModuleInterfaceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
// If the compiler has been asked to be strict with ensuring downstream dependencies
// get the parent invocation's context, or this is an Explicit build, inherit the
// extra Clang arguments also.
if (LoaderOpts.strictImplicitModuleContext || LoaderOpts.disableImplicitSwiftModule) {
if (LoaderOpts.strictImplicitModuleContext || LoaderOpts.disableImplicitSwiftModule ||
LoaderOpts.requestedAction == FrontendOptions::ActionType::ScanDependencies) {
// Inherit any clang-specific state of the compilation (macros, clang flags, etc.)
subClangImporterOpts.ExtraArgs = clangImporterOpts.ExtraArgs;
for (auto arg : subClangImporterOpts.ExtraArgs) {
Expand Down
35 changes: 35 additions & 0 deletions test/ScanDependencies/ObjCStrict.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/clang-module-cache)

// 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
// Check the contents of the JSON output
// RUN: %validate-json %t/deps.json | %FileCheck %s

// REQUIRES: executable_test
// REQUIRES: objc_interop

import C

// CHECK: "mainModuleName": "deps"
/// --------Main module
// CHECK-LABEL: "modulePath": "deps.swiftmodule",
// CHECK-NEXT: sourceFiles
// CHECK-NEXT: ObjCStrict.swift
// CHECK-NEXT: ],
// CHECK-NEXT: "directDependencies": [
// CHECK-DAG: "clang": "C"
// CHECK-DAG: "swift": "Swift"
// CHECK-DAG: "swift": "SwiftOnoneSupport"
// CHECK-DAG: "swift": "_Concurrency"
// CHECK: ],

// CHECK: "swift": "A"
// CHECK: "swift": {
// CHECK-NEXT: "moduleInterfacePath": "{{.*}}{{/|\\}}Inputs{{/|\\}}Swift{{/|\\}}A.swiftinterface",
// CHECK: "commandLine": [
// CHECK: "-fobjc-disable-direct-methods-for-testing"
// CHECK: "-o",
// CHECK-NEXT: "{{.*}}{{/|\\}}A-{{.*}}.swiftmodule",