Skip to content

Commit 7992d77

Browse files
Add macCatalyst to the PlatformChecks (apple#524)
### Motivation When attempting to compile the Swift OpenAPI Generator on MacCatalyst, code that compiles on iOS will _not_ compile as it will fail on the `PlatformChecks`. ### Modifications Added an extra condition in `PlatformChecks` to allow running on MacCatalyst. ### Result fixes apple#523 ### Test Plan I've tried to familiarize myself with the project, but could not come up with a good way to add a test for running the tool on MacCatalyst. In my manual testing giving the instructions in the issue, it now works as expected.
1 parent 7bd8dad commit 7992d77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/_OpenAPIGeneratorCore/PlatformChecks.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
// Emit a compiler error if this library is linked with a target in an adopter
1616
// project.
17-
#if !(os(macOS) || os(Linux))
17+
//
18+
// When compiling for MacCatalyst, the plugin is (erroneously?) compiled with os(iOS).
19+
#if !(os(macOS) || os(Linux) || (os(iOS) && targetEnvironment(macCatalyst)))
1820
#error(
1921
"_OpenAPIGeneratorCore is only to be used by swift-openapi-generator itself—your target should not link this library or the command line tool directly."
2022
)

0 commit comments

Comments
 (0)