Skip to content

Conversation

daveinglis
Copy link
Contributor

  • fix adding -lc++ to OTHER_LDFLAGS to match native build system.
  • remove OTHER_LDRFLAGS setting
@daveinglis
Copy link
Contributor Author

@swift-ci test

- fix adding -lc++ to OTHER_LDFLAGS to match native build system.
@daveinglis
Copy link
Contributor Author

@swift-ci test

1 similar comment
@daveinglis
Copy link
Contributor Author

@swift-ci test

@daveinglis
Copy link
Contributor Author

@swift-ci test windows

@daveinglis daveinglis enabled auto-merge (squash) October 20, 2025 20:19
@daveinglis
Copy link
Contributor Author

@jakepetroules I need you to review and remove you requested change if you are ok with this.

Copy link
Contributor

@jakepetroules jakepetroules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but I think there's still a couple improvements you could make (see inline comments)


if sourceModule.isCxx {
for platform in ProjectModel.BuildSettings.Platform.allCases {
// darwin & freebsd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of if-else, can you use a switch?

switch platform { case .macOS, .macCatalyst, .iOS, .watchOS, .tvOS, .xrOS, .driverKit, .freebsd: settings[.OTHER_LDFLAGS, platform] = ["-lc++", "$(inherited)"] case .android, .linux, .wasi, .openbsd: settings[.OTHER_LDFLAGS, platform] = ["-lstdc++", "$(inherited)"] case .windows: break // no flags needed }

That will benefit from exhaustivity checking and the compiler will force us to implement the right flags when we add a new platform (like NetBSD or QNX for example).


for platform in ProjectModel.BuildSettings.Platform.allCases {
let ld_flags = releaseConfig.settings[.OTHER_LDFLAGS, platform]
if [.macOS, .macCatalyst, .iOS, .watchOS, .tvOS, .xrOS, .driverKit, .freebsd].contains(platform) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use a switch here as well

@daveinglis daveinglis merged commit fae1549 into swiftlang:main Oct 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants