Skip to content

Conversation

tustanivsky
Copy link
Collaborator

This PR resolves packaging errors in UE 5.4 and 5.5 due to a missing SWIFT_PACKAGE define when targeting Apple platforms. The problem was discovered after submitting version 1.0.0 to FAB.

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

What's the error, out of curiosity? Shouldn't #if SWIFT_PACKAGE and #if !SWIFT_PACKAGE in sentry-cocoa headers work fine with a C++ compiler without explicitly defining SWIFT_PACKAGE=0? Does Unreal packaging process involve reading and parsing those headers with some custom tooling?

@tustanivsky
Copy link
Collaborator Author

What's the error, out of curiosity? Shouldn't #if SWIFT_PACKAGE and #if !SWIFT_PACKAGE in sentry-cocoa headers work fine with a C++ compiler without explicitly defining SWIFT_PACKAGE=0? Does Unreal packaging process involve reading and parsing those headers with some custom tooling?

error: 'SWIFT_PACKAGE' is not defined, evaluates to 0 [-Werror,-Wundef]

Unreal builds with -Wundef so missing defines trigger warnings which are promoted to errors via -Werror. Interestingly, UE 5.6 doesn’t fail on this which might indicate that Epic changed the default warning/error configuration for packaging in that version.

@tustanivsky tustanivsky merged commit 8bb5956 into main Sep 2, 2025
29 checks passed
@tustanivsky tustanivsky deleted the fix/swift-package-define branch September 2, 2025 10:45
mujacica pushed a commit that referenced this pull request Sep 19, 2025
* Add missing `SWIFT_PACKAGE` define

* Update changelog

* Link PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants