forked from Stremio/stremio-core-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for compiling xcode package directly
- Loading branch information
Showing
13 changed files
with
671 additions
and
278 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
LIBRARY_NAME := libstremio_core_swift | ||
FRAMEWORK_NAME := StremioCore | ||
.PHONY: all | ||
|
||
all: macos ios iossim package | ||
|
||
macos: | ||
@cargo +nightly build -Z build-std --release --lib --target aarch64-apple-ios-macabi | ||
@cargo +nightly build -Z build-std --release --lib --target x86_64-apple-ios-macabi | ||
@$(RM) -rf target/universal/$(LIBRARY_NAME)-macabi.a | ||
@mkdir -p target/universal/ | ||
@lipo -create -output target/universal/$(LIBRARY_NAME)-macabi.a \ | ||
target/aarch64-apple-ios-macabi/release/$(LIBRARY_NAME).a \ | ||
target/x86_64-apple-ios-macabi/release/$(LIBRARY_NAME).a | ||
|
||
ios: | ||
@cargo build --release --lib --target aarch64-apple-ios | ||
@$(RM) -rf target/universal/$(LIBRARY_NAME)-ios.a | ||
@mkdir -p target/universal/ | ||
@cp target/aarch64-apple-ios/release/$(LIBRARY_NAME).a target/universal/$(LIBRARY_NAME)-ios.a | ||
|
||
iossim: | ||
@cargo build --release --lib --target aarch64-apple-ios-sim | ||
@cargo build --release --lib --target x86_64-apple-ios | ||
@$(RM) -rf target/universal/$(LIBRARY_NAME)-ios-sim.a | ||
@mkdir -p target/universal/ | ||
@lipo -create -output target/universal/$(LIBRARY_NAME)-ios-sim.a \ | ||
target/aarch64-apple-ios-sim/release/$(LIBRARY_NAME).a \ | ||
target/x86_64-apple-ios/release/$(LIBRARY_NAME).a | ||
|
||
framework: | ||
@mkdir -p build/ | ||
@$(RM) -rf build/$(FRAMEWORK_NAME).xcframework | ||
@xcodebuild -create-xcframework \ | ||
-library target/universal/$(LIBRARY_NAME)-ios.a \ | ||
-library target/universal/$(LIBRARY_NAME)-ios-sim.a \ | ||
-library target/universal/$(LIBRARY_NAME)-macabi.a \ | ||
-output build/$(FRAMEWORK_NAME).xcframework | ||
|
||
package: framework | ||
@$(RM) -rf build/StremioCore | ||
@cp -rf bridge/StremioCore build/ | ||
@./buildBridge.command | ||
@mv build/$(FRAMEWORK_NAME).xcframework build/StremioCore/Frameworks/$(FRAMEWORK_NAME).xcframework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
Sources/StremioCore/stremio | ||
.netrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "StremioCore", | ||
platforms: [ | ||
.macCatalyst(.v13), | ||
.iOS(.v12), | ||
], | ||
products: [ | ||
.library( | ||
name: "StremioCore", | ||
targets: ["StremioCore", "XCFramework"]), | ||
], dependencies: [ | ||
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.0"), | ||
], | ||
targets: [ | ||
.target(name: "Wrapper", dependencies: []), | ||
.target(name: "StremioCore", | ||
dependencies: [ | ||
"Wrapper", | ||
.product(name: "SwiftProtobuf", package: "swift-protobuf") | ||
]), | ||
.binaryTarget(name: "XCFramework", path: "Frameworks/StremioCore.xcframework") | ||
] | ||
) |
Oops, something went wrong.