Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cxx-interop] Propagate interop flag to the test entry point target #7428

Merged
merged 1 commit into from Mar 28, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -555,11 +555,11 @@ package final class SwiftTargetBuildDescription {
args += ["-color-diagnostics"]
}

// If this is a generated test discovery target, it might import a test
// If this is a generated test discovery target or a test entry point, it might import a test
// target that is built with C++ interop enabled. In that case, the test
// discovery target must enable C++ interop as well
switch testTargetRole {
case .discovery:
case .discovery, .entryPoint:
for dependency in try self.target.recursiveTargetDependencies() {
let dependencyScope = self.buildParameters.createScope(for: dependency)
let dependencySwiftFlags = dependencyScope.evaluate(.OTHER_SWIFT_FLAGS)
Expand Down
3 changes: 3 additions & 0 deletions Tests/BuildTests/BuildPlanTests.swift
Expand Up @@ -4063,6 +4063,9 @@ final class BuildPlanTests: XCTestCase {

let testDiscovery = try result.target(for: "APackageDiscoveredTests").swiftTarget().compileArguments()
XCTAssertMatch(testDiscovery, [.anySequence, "-cxx-interoperability-mode=default", "-Xcc", "-std=c++17"])

let testEntryPoint = try result.target(for: "APackageTests").swiftTarget().compileArguments()
XCTAssertMatch(testEntryPoint, [.anySequence, "-cxx-interoperability-mode=default", "-Xcc", "-std=c++17"])
}

// omit frame pointers explicitly set to true
Expand Down