Skip to content

Commit 9e1614b

Browse files
luserthomccJohnTitor
authored
Revert #110 to fix iOS cross-compilation after #158. Fixes #173 (#176)
* add an iOS cross-compile test to CI * Fix zlib-ng compilation for iOS * Revert #110 to fix iOS cross-compilation after #158. Fixes #173 In #158, better support for using CMake's cross-compilation facilities was added. This made the workaround added in #110 for iOS not only unnecessary, but actively harmful, in that it runs afoul of SDK validation checks in the CMake iOS codepath. * Use checkout@v3 Co-authored-by: Yuki Okushi <[email protected]> --------- Co-authored-by: Thom Chiovoloni <[email protected]> Co-authored-by: Yuki Okushi <[email protected]>
1 parent 65bf352 commit 9e1614b

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/main.yml

+22
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,25 @@ jobs:
8383
run: cross build -vv --target ${{ matrix.platform.target }}
8484
working-directory: test-crate
8585
if: ${{ !matrix.platform.test }}
86+
87+
ios_cross_compile_test:
88+
name: Test Cross Compile - ${{ matrix.platform.target }}
89+
needs: [ test ]
90+
runs-on: macos-latest
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
platform:
95+
- target: aarch64-apple-ios
96+
steps:
97+
- uses: actions/checkout@v3
98+
- uses: actions-rs/toolchain@v1
99+
with:
100+
toolchain: stable
101+
target: ${{ matrix.platform.target }}
102+
- name: build
103+
run: cargo build -vv --target ${{ matrix.platform.target }}
104+
working-directory: test-crate
105+
env:
106+
# If this isn't specified the default is iOS 7, for which zlib-ng will not compile due to the lack of thread-local storage.
107+
IPHONEOS_DEPLOYMENT_TARGET: 16

src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -660,12 +660,6 @@ impl Config {
660660
panic!("unsupported msvc target: {}", target);
661661
}
662662
}
663-
} else if target.contains("apple-ios") || target.contains("apple-tvos") {
664-
// These two flags prevent CMake from adding an OSX sysroot, which messes up compilation.
665-
if !self.defined("CMAKE_OSX_SYSROOT") && !self.defined("CMAKE_OSX_DEPLOYMENT_TARGET") {
666-
cmd.arg("-DCMAKE_OSX_SYSROOT=/");
667-
cmd.arg("-DCMAKE_OSX_DEPLOYMENT_TARGET=");
668-
}
669663
} else if target.contains("darwin") {
670664
if !self.defined("CMAKE_OSX_ARCHITECTURES") {
671665
if target.contains("x86_64") {

0 commit comments

Comments
 (0)