Support iOS

This commit is contained in:
momo5502
2025-03-26 15:23:31 +01:00
parent 6fb7450e0f
commit 448e11b737
2 changed files with 12 additions and 1 deletions

View File

@@ -180,6 +180,7 @@ jobs:
clang-version: 20
- platform: iOS arm64
runner: macos-latest
rust-target: aarch64-apple-ios
cmake-options: "-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/toolchain/ios.cmake"
- platform: macOS arm64
runner: macos-latest
@@ -202,6 +203,10 @@ jobs:
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v6
- name: Install Rust Target
if: "${{ matrix.rust-target }}"
run: rustup target add ${{ matrix.rust-target }}
- name: Install Clang
if: "${{ matrix.platform == 'Linux x86_64 Clang' }}"
run: |

View File

@@ -10,13 +10,19 @@ if(MSVC)
set(ICICLE_RUST_LIB ${ICICLE_ARTIFACT_DIR}/${ICICLE_RUST_PROJECT_NAME}.lib)
endif()
set(CARGO_OPTIONS "")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CARGO_OPTIONS "--target=aarch64-apple-ios")
endif()
ExternalProject_Add(
icicle-rust-project
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_COMMAND} -E env "CARGO_TARGET_DIR=${ICICLE_BUILD_DIR}" cargo build --all-targets $<IF:$<CONFIG:Debug>,--lib,--release>
BUILD_COMMAND ${CMAKE_COMMAND} -E env "CARGO_TARGET_DIR=${ICICLE_BUILD_DIR}" cargo build ${CARGO_OPTIONS} --all-targets $<IF:$<CONFIG:Debug>,--lib,--release>
INSTALL_COMMAND ""
USES_TERMINAL_CONFIGURE 1
USES_TERMINAL_BUILD 1