diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbacbc2..63c5b83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,3 +83,25 @@ jobs: run: cross build -vv --target ${{ matrix.platform.target }} working-directory: test-crate if: ${{ !matrix.platform.test }} + + ios_cross_compile_test: + name: Test Cross Compile - ${{ matrix.platform.target }} + needs: [ test ] + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + platform: + - target: aarch64-apple-ios + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.platform.target }} + - name: build + run: cargo build -vv --target ${{ matrix.platform.target }} + working-directory: test-crate + env: + # 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. + IPHONEOS_DEPLOYMENT_TARGET: 16 diff --git a/src/lib.rs b/src/lib.rs index 736aeec..65dcef6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -660,12 +660,6 @@ impl Config { panic!("unsupported msvc target: {}", target); } } - } else if target.contains("apple-ios") || target.contains("apple-tvos") { - // These two flags prevent CMake from adding an OSX sysroot, which messes up compilation. - if !self.defined("CMAKE_OSX_SYSROOT") && !self.defined("CMAKE_OSX_DEPLOYMENT_TARGET") { - cmd.arg("-DCMAKE_OSX_SYSROOT=/"); - cmd.arg("-DCMAKE_OSX_DEPLOYMENT_TARGET="); - } } else if target.contains("darwin") { if !self.defined("CMAKE_OSX_ARCHITECTURES") { if target.contains("x86_64") {