mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-20 22:09:09 +00:00
building script
This commit is contained in:
parent
3a156f5837
commit
c9272609b8
3 changed files with 16 additions and 14 deletions
3
.github/workflows/publish-exe.yml
vendored
3
.github/workflows/publish-exe.yml
vendored
|
@ -71,8 +71,7 @@ jobs:
|
||||||
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.dylib
|
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.dylib
|
||||||
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
|
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
|
||||||
./build-apple.sh
|
./build-apple.sh
|
||||||
mv ./target/Tun2Proxy.xcframework .
|
zip -r mypubdir4/tun2proxy-apple-xcframework.zip ./tun2proxy.xcframework/
|
||||||
zip -r mypubdir4/tun2proxy-apple-xcframework.zip ./Tun2Proxy.xcframework/
|
|
||||||
fi
|
fi
|
||||||
elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
|
elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
|
||||||
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.so
|
zip -j mypubdir4/tun2proxy-${{ matrix.target }}.zip target/${{ matrix.target }}/release/tun2proxy README.md target/tun2proxy-ffi.h target/${{ matrix.target }}/release/libtun2proxy.so
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
tun2proxy.xcframework/
|
||||||
.env
|
.env
|
||||||
project.xcworkspace/
|
project.xcworkspace/
|
||||||
xcuserdata/
|
xcuserdata/
|
||||||
|
|
|
@ -15,7 +15,7 @@ echo "Generating includes..."
|
||||||
mkdir -p target/include/
|
mkdir -p target/include/
|
||||||
cbindgen --config cbindgen.toml -l C -o target/include/tun2proxy.h
|
cbindgen --config cbindgen.toml -l C -o target/include/tun2proxy.h
|
||||||
cat > target/include/module.modulemap <<EOF
|
cat > target/include/module.modulemap <<EOF
|
||||||
framework module Tun2Proxy {
|
framework module tun2proxy {
|
||||||
umbrella header "tun2proxy.h"
|
umbrella header "tun2proxy.h"
|
||||||
|
|
||||||
export *
|
export *
|
||||||
|
@ -24,21 +24,23 @@ framework module Tun2Proxy {
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "lipo..."
|
echo "lipo..."
|
||||||
|
|
||||||
echo "Simulator"
|
echo "Simulator"
|
||||||
lipo -create \
|
lipo -create \
|
||||||
target/aarch64-apple-ios-sim/release/libtun2proxy.a \
|
target/aarch64-apple-ios-sim/release/libtun2proxy.a \
|
||||||
target/x86_64-apple-ios/release/libtun2proxy.a \
|
target/x86_64-apple-ios/release/libtun2proxy.a \
|
||||||
-output ./target/libtun2proxy-ios-sim.a
|
-output ./target/libtun2proxy-ios-sim.a
|
||||||
|
|
||||||
echo "MacOS"
|
echo "MacOS"
|
||||||
lipo -create \
|
lipo -create \
|
||||||
target/aarch64-apple-darwin/release/libtun2proxy.a \
|
target/aarch64-apple-darwin/release/libtun2proxy.a \
|
||||||
target/x86_64-apple-darwin/release/libtun2proxy.a \
|
target/x86_64-apple-darwin/release/libtun2proxy.a \
|
||||||
-output ./target/libtun2proxy-macos.a
|
-output ./target/libtun2proxy-macos.a
|
||||||
|
|
||||||
echo "Creating XCFramework"
|
echo "Creating XCFramework"
|
||||||
rm -rf ./target/Tun2Proxy.xcframework
|
rm -rf ./tun2proxy.xcframework
|
||||||
xcodebuild -create-xcframework \
|
xcodebuild -create-xcframework \
|
||||||
-library ./target/aarch64-apple-ios/release/libtun2proxy.a -headers ./target/include/ \
|
-library ./target/aarch64-apple-ios/release/libtun2proxy.a -headers ./target/include/ \
|
||||||
-library ./target/libtun2proxy-ios-sim.a -headers ./target/include/ \
|
-library ./target/libtun2proxy-ios-sim.a -headers ./target/include/ \
|
||||||
-library ./target/libtun2proxy-macos.a -headers ./target/include/ \
|
-library ./target/libtun2proxy-macos.a -headers ./target/include/ \
|
||||||
-output ./target/Tun2Proxy.xcframework
|
-output ./tun2proxy.xcframework
|
||||||
|
|
Loading…
Add table
Reference in a new issue