Skip to content

Commit 0adfccb

Browse files
Adjust the platform-based linkage check (#737)
Limit this to Apple platforms except macOS in order to unblock use of swift-openapi-generator on more platforms like Windows, Android, FreeBSD, and so on.
1 parent 8bc24a3 commit 0adfccb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: Sources/_OpenAPIGeneratorCore/PlatformChecks.swift

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

1515
// Emit a compiler error if this library is linked with a target in an adopter
1616
// project.
17-
//
18-
// When compiling for MacCatalyst, the plugin is (erroneously?) compiled with os(iOS).
19-
#if !(os(macOS) || os(Linux) || (os(iOS) && targetEnvironment(macCatalyst)))
17+
// This is only done for platforms where the linkage was most likely added
18+
// erroneously (for platforms which can't be used as development hosts).
19+
#if (os(iOS) && !targetEnvironment(macCatalyst)) || os(tvOS) || os(watchOS) || os(visionOS)
2020
#error(
2121
"_OpenAPIGeneratorCore is only to be used by swift-openapi-generator itself—your target should not link this library or the command line tool directly."
2222
)

0 commit comments

Comments
 (0)