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

Azure CI: Build and bundle shared libs for iOS too #3764

Merged
merged 1 commit into from
Jun 15, 2021
Merged
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
15 changes: 4 additions & 11 deletions .azure-pipelines/4a-mac_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,27 @@ steps:
CMAKE_OSX_ARCHITECTURES=arm64 \
CMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
BUILD_LTO_LIBS=ON
# TODO: build shared libs too, and look into `-fvisibility=hidden` requirement
build/bin/ldc-build-runtime --ninja -j $PARALLEL_JOBS \
--buildDir=build-libs-ios-arm64 \
--dFlags="-mtriple=$triple_ios_arm64;-fvisibility=hidden" \
--dFlags="-mtriple=$triple_ios_arm64" \
--ldcSrcDir=$BUILD_SOURCESDIRECTORY \
CMAKE_SYSTEM_NAME=iOS \
CMAKE_OSX_ARCHITECTURES=arm64 \
CMAKE_OSX_DEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET \
BUILD_SHARED_LIBS=OFF \
BUILD_LTO_LIBS=ON
build/bin/ldc-build-runtime --ninja -j $PARALLEL_JOBS \
--buildDir=build-libs-ios-x86_64 \
--dFlags="-mtriple=$triple_ios_x64;-fvisibility=hidden" \
--dFlags="-mtriple=$triple_ios_x64" \
--ldcSrcDir=$BUILD_SOURCESDIRECTORY \
CMAKE_SYSTEM_NAME=iOS \
CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \
CMAKE_OSX_ARCHITECTURES=x86_64 \
CMAKE_OSX_DEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET \
BUILD_SHARED_LIBS=OFF \
BUILD_LTO_LIBS=ON
mkdir installed/lib-{arm64,ios-arm64,ios-x86_64}
cp -a build-libs-arm64/lib/*.{a,dylib} installed/lib-arm64
cp build-libs-ios-arm64/lib/*.a installed/lib-ios-arm64
cp build-libs-ios-x86_64/lib/*.a installed/lib-ios-x86_64
cp -a build-libs-ios-arm64/lib/*.{a,dylib} installed/lib-ios-arm64
cp -a build-libs-ios-x86_64/lib/*.{a,dylib} installed/lib-ios-x86_64
sections="
\"arm64-apple-macos\":
{
Expand All @@ -64,8 +61,6 @@ steps:
{
switches = [
\"-defaultlib=phobos2-ldc,druntime-ldc\",
\"-link-defaultlib-shared=false\",
\"-fvisibility=hidden\",
\"-Xcc=-target\",
\"-Xcc=$triple_ios_arm64\",
\"-Xcc=-miphoneos-version-min=$IOS_DEPLOYMENT_TARGET\",
Expand All @@ -82,8 +77,6 @@ steps:
{
switches = [
\"-defaultlib=phobos2-ldc,druntime-ldc\",
\"-link-defaultlib-shared=false\",
\"-fvisibility=hidden\",
\"-Xcc=-target\",
\"-Xcc=$triple_ios_x64\",
\"-Xcc=-miphoneos-version-min=$IOS_DEPLOYMENT_TARGET\",
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ jobs:
installed/bin/ldc2 -mtriple="arm64-apple-macos" hello.d -of=hello_arm64
installed/bin/ldc2 -mtriple="arm64-apple-macos" hello.d -of=hello_arm64_shared -link-defaultlib-shared
installed/bin/ldc2 -mtriple="arm64-apple-ios$IOS_DEPLOYMENT_TARGET" hello.d -of=hello_ios_arm64
installed/bin/ldc2 -mtriple="arm64-apple-ios$IOS_DEPLOYMENT_TARGET" hello.d -of=hello_ios_arm64_shared -link-defaultlib-shared
installed/bin/ldc2 -mtriple="x86_64-apple-ios$IOS_DEPLOYMENT_TARGET" hello.d -of=hello_ios_x86_64
installed/bin/ldc2 -mtriple="x86_64-apple-ios$IOS_DEPLOYMENT_TARGET" hello.d -of=hello_ios_x86_64_shared -link-defaultlib-shared
displayName: 'Cross-compile & -link hello-world for arm64 and iOS'
- template: .azure-pipelines/6-package.yml

Expand Down