Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added simulator arm64 support for iOS #54

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Example/iOS Example/iOS Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 2YBG8BB5C7;
INFOPLIST_FILE = Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.github.openfresh.videocast.ios-example";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -611,6 +612,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 2YBG8BB5C7;
INFOPLIST_FILE = Resources/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.github.openfresh.videocast.ios-example";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion SRT/build_openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

pushd ./openssl

./build-libssl.sh --archs="x86_64 i386 armv7 arm64"
./build-libssl.sh --archs="x86_64 i386 armv7 arm64" --version=1.1.1d

popd

Expand Down
26 changes: 20 additions & 6 deletions SRT/build_srt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,44 @@
# Copyright © 2018年 CyberAgent, Inc. All rights reserved.

export IPHONEOS_DEPLOYMENT_TARGET=8.0
SDKVERSION=13.4

build_srt() {
PLATFORM=$1
IOS_PLATFORM=$2
ARCH=$3
IOS_OPENSSL=$(pwd)/openssl/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk
IOS_OPENSSL=$(ls -d "$(pwd)/openssl/bin/${PLATFORM}"*-"${ARCH}".sdk)

mkdir -p ./build/ios_${IOS_PLATFORM}_${ARCH}
pushd ./build/ios_${IOS_PLATFORM}_${ARCH}

mkdir -p ./build/ios_${ARCH}
pushd ./build/ios_${ARCH}
cp $IOS_OPENSSL/lib/libcrypto.a .

../../srt/configure --cmake-prefix-path=$IOS_OPENSSL --use-openssl-pc=OFF --cmake-toolchain-file=scripts/iOS.cmake --enable-debug=0 --ios-platform=${IOS_PLATFORM} --ios-arch=${ARCH}
make
popd
}
# clear out the cmake build cache
rm -rf build
rm -rf libsrt.xcframework
rm -rf libcrypto.xcframework

build_srt iPhoneSimulator SIMULATOR64 x86_64
build_srt iPhoneSimulator SIMULATOR64 arm64
build_srt iPhoneOS OS arm64

cp ./build/ios_arm64/version.h Includes
cp ./build/ios_OS_arm64/version.h Includes
cp ./srt/srtcore/srt.h Includes
cp ./srt/srtcore/logging_api.h Includes
cp ./srt/srtcore/platform_sys.h Includes
cp ./srt/srtcore/udt.h Includes
cp ./srt/srtcore/srt4udt.h Includes

lipo -output libsrt.a -create ./build/ios_x86_64/libsrt.a ./build/ios_arm64/libsrt.a
lipo -output libsrt.a -create ./build/ios_SIMULATOR64_x86_64/libsrt.a ./build/ios_SIMULATOR64_arm64/libsrt.a
xcodebuild -create-xcframework -library libsrt.a -library ./build/ios_OS_arm64/libsrt.a -output libsrt.xcframework

lipo -output libcrypto.a -create ./build/ios_SIMULATOR64_x86_64/libcrypto.a ./build/ios_SIMULATOR64_arm64/libcrypto.a
xcodebuild -create-xcframework -library libcrypto.a -library ./build/ios_OS_arm64/libcrypto.a -output libcrypto.xcframework

# clear out the cache of libsrt.a and libcrypto.a
rm libsrt.a
rm libcrypto.a
40 changes: 40 additions & 0 deletions SRT/libcrypto.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libcrypto.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libcrypto.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file added SRT/libcrypto.xcframework/ios-arm64/libcrypto.a
Binary file not shown.
Binary file not shown.
Binary file removed SRT/libsrt.a
Binary file not shown.
40 changes: 40 additions & 0 deletions SRT/libsrt.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libsrt.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libsrt.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file added SRT/libsrt.xcframework/ios-arm64/libsrt.a
Binary file not shown.
Binary file not shown.
93 changes: 75 additions & 18 deletions VideoCast.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
68B3B1FD2A013F8E00519C5B /* libcrypto.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68B3B1F72A013E3100519C5B /* libcrypto.xcframework */; };
68B3B1FE2A013F8E00519C5B /* libcrypto.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 68B3B1F72A013E3100519C5B /* libcrypto.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
68B3B2002A013F9000519C5B /* libsrt.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68B3B1F62A013E3000519C5B /* libsrt.xcframework */; };
68B3B2012A013F9000519C5B /* libsrt.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 68B3B1F62A013E3000519C5B /* libsrt.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
811531852021647900919F9F /* IThroughputAdaptation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 811531842021647900919F9F /* IThroughputAdaptation.swift */; };
811531862021647900919F9F /* IThroughputAdaptation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 811531842021647900919F9F /* IThroughputAdaptation.swift */; };
8115318820216A7F00919F9F /* TCPThroughputAdaptation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8115318720216A7F00919F9F /* TCPThroughputAdaptation.swift */; };
Expand Down Expand Up @@ -47,8 +51,6 @@
814265D71FFF6F35001258F2 /* IAudioMixer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 814265D51FFF6F35001258F2 /* IAudioMixer.swift */; };
814EA591205AD18D002D4657 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 814EA590205AD18D002D4657 /* LICENSE */; };
814EA593205AD199002D4657 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 814EA592205AD199002D4657 /* README.md */; };
8161D57E2057A82800813B7A /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8161D57B20578A2B00813B7A /* libcrypto.a */; };
8161D57F2057A82800813B7A /* libsrt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81BFD40920578428002E90D8 /* libsrt.a */; };
816E872D1FFE34EB005ACB46 /* VideoCast.h in Headers */ = {isa = PBXBuildFile; fileRef = 818C0AFA1FFE1B62008CF132 /* VideoCast.h */; settings = {ATTRIBUTES = (Public, ); }; };
816E872E1FFE3612005ACB46 /* VideoCast.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 818C0B121FFE1DDB008CF132 /* VideoCast.framework */; };
816ECEA01FFF27D4002AE4F9 /* VCSessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 816ECE9F1FFF27D4002AE4F9 /* VCSessionDelegate.swift */; };
Expand Down Expand Up @@ -215,7 +217,24 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
68B3B1FF2A013F8E00519C5B /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
68B3B1FE2A013F8E00519C5B /* libcrypto.xcframework in Embed Frameworks */,
68B3B2012A013F9000519C5B /* libsrt.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
68B3B1F62A013E3000519C5B /* libsrt.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libsrt.xcframework; path = SRT/libsrt.xcframework; sourceTree = "<group>"; };
68B3B1F72A013E3100519C5B /* libcrypto.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libcrypto.xcframework; path = SRT/libcrypto.xcframework; sourceTree = "<group>"; };
811531842021647900919F9F /* IThroughputAdaptation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IThroughputAdaptation.swift; sourceTree = "<group>"; };
8115318720216A7F00919F9F /* TCPThroughputAdaptation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TCPThroughputAdaptation.swift; sourceTree = "<group>"; };
8115318A2021744600919F9F /* PreallocBuffer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreallocBuffer.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -342,9 +361,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8161D57E2057A82800813B7A /* libcrypto.a in Frameworks */,
8161D57F2057A82800813B7A /* libsrt.a in Frameworks */,
81B8CD6F204F943F00B581F6 /* libc++.tbd in Frameworks */,
68B3B2002A013F9000519C5B /* libsrt.xcframework in Frameworks */,
68B3B1FD2A013F8E00519C5B /* libcrypto.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -385,6 +404,8 @@
810C8CF2204E4B43002DFDCB /* Frameworks */ = {
isa = PBXGroup;
children = (
68B3B1F72A013E3100519C5B /* libcrypto.xcframework */,
68B3B1F62A013E3000519C5B /* libsrt.xcframework */,
81B8CD6C204F93D700B581F6 /* libcrypto.a */,
81B8CD6A204F93B000B581F6 /* libssl.a */,
81B8CD6E204F943E00B581F6 /* libc++.tbd */,
Expand Down Expand Up @@ -762,6 +783,7 @@
811BF9931FFE2F7D00E90EEF /* Frameworks */,
811BF9941FFE2F7D00E90EEF /* Headers */,
811BF9951FFE2F7D00E90EEF /* Resources */,
68B3B1FF2A013F8E00519C5B /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -1151,14 +1173,19 @@
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 2YBG8BB5C7;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/SRT/srt/srtcore";
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/SRT",
Expand All @@ -1182,14 +1209,19 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 2YBG8BB5C7;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/SRT/srt/srtcore";
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/SRT",
Expand All @@ -1213,7 +1245,11 @@
DEVELOPMENT_TEAM = 5PN926HWK3;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "jp.co.cyberagent.VideoCast-iOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
Expand All @@ -1229,7 +1265,11 @@
DEVELOPMENT_TEAM = 5PN926HWK3;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "jp.co.cyberagent.VideoCast-iOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
Expand Down Expand Up @@ -1346,8 +1386,9 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/SRT";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -1363,14 +1404,18 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 2YBG8BB5C7;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.openfresh.videocast;
PRODUCT_NAME = VideoCast;
SDKROOT = macosx;
Expand All @@ -1389,14 +1434,18 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 2YBG8BB5C7;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.openfresh.videocast;
PRODUCT_NAME = VideoCast;
SDKROOT = macosx;
Expand All @@ -1414,7 +1463,11 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 5PN926HWK3;
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "jp.co.cyberagent.VideoCast-macOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1432,7 +1485,11 @@
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 5PN926HWK3;
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "jp.co.cyberagent.VideoCast-macOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down