PlatformChecks emits error when compiling for MacCatalyst #523
Labels
kind/bug
Feature doesn't work as expected.
status/triage
Collecting information required to triage the issue.
Description
When attempting to compile the Swift OpenAPI Generator on MacCatalyst, code that compiles perfectly on iOS will not run as it will fail on the
PlatformChecks
. This is unexpected.Reproduction
Use the same instructions as used in https://developer.apple.com/wwdc23/10171 but enable the MacCatalyst target in the project settings. The project will compile fine for iOS but when targeting mac, the following error will be emitted:
OpenAPIGeneratorCore is only to be used by swift-openapi-generator itself—your target should not link this library or the command line tool directly.
Package version(s)
1.2.0
Expected behavior
I would have expected this to work fine without extra adjusments.
Environment
macOS Sonoma
Xcode 15.2
Additional information
I suspect that it has to do with the behaviour of MacCatalyst. When compiling the app normally
targetEnvironment(macCatalyst)
will be true whileos(macOS)
will be false which is already confusing by itself but with good reason. Perhaps the build tool plug-in is ran in a similar environment?It looked like from my limited testing that when disabling this check it will not include the runtime, so the setup should be correct.
The text was updated successfully, but these errors were encountered: