mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Adds windows swift support (#8622)
Adding support for windows requires the code generations to add a compiler statement to completely ignore GRPC code generation on windows Cleanup the project to use the main Package.swift to run tests instead of having it separate and includes the imports for GRPC within it. Adds windows swift ci
This commit is contained in:
@@ -31,6 +31,7 @@ let package = Package(
|
||||
name: "FlexBuffers",
|
||||
targets: ["FlexBuffers"]),
|
||||
],
|
||||
dependencies: .dependencies,
|
||||
targets: [
|
||||
.target(
|
||||
name: "FlatBuffers",
|
||||
@@ -42,6 +43,40 @@ let package = Package(
|
||||
path: "swift/Sources/FlexBuffers"),
|
||||
.target(
|
||||
name: "Common",
|
||||
dependencies: [],
|
||||
path: "swift/Sources/Common"),
|
||||
.testTarget(
|
||||
name: "FlatbuffersTests",
|
||||
dependencies: .dependencies,
|
||||
path: "tests/swift/Tests/Flatbuffers"
|
||||
),
|
||||
.testTarget(
|
||||
name: "FlexbuffersTests",
|
||||
dependencies: ["FlexBuffers"],
|
||||
path: "tests/swift/Tests/Flexbuffers"
|
||||
)
|
||||
])
|
||||
|
||||
extension Array where Element == Package.Dependency {
|
||||
static var dependencies: [Package.Dependency] {
|
||||
#if os(Windows)
|
||||
[]
|
||||
#else
|
||||
// Test only Dependency
|
||||
[.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.4.1")]
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
extension Array where Element == PackageDescription.Target.Dependency {
|
||||
static var dependencies: [PackageDescription.Target.Dependency] {
|
||||
#if os(Windows)
|
||||
["FlatBuffers"]
|
||||
#else
|
||||
// Test only Dependency
|
||||
[
|
||||
.product(name: "GRPC", package: "grpc-swift"),
|
||||
"FlatBuffers"
|
||||
]
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user