File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ jobs:
103103 export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc
104104 export CC=aarch64-linux-gnu-gcc
105105 fi
106+ export RUSTFLAGS="--crate-type=staticlib,cdylib"
106107 cargo build --verbose --release --target ${{matrix.cargo_target}}
107108 - name : Build archive
108109 shell : bash
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ name = "iroh"
2121
2222[lib ]
2323name = " iroh_ffi"
24- crate-type = [" staticlib" , " cdylib" ]
2524
2625[[bin ]]
2726name = " uniffi-bindgen"
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ case "$(uname -s)" in
8686esac
8787TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | python3 -c 'import json,sys;print(json.load(sys.stdin)["target_directory"])')
8888LIB="$TARGET_DIR/debug/${LIB_NAME}.${EXT}"
89+ export RUSTFLAGS="--crate-type=staticlib,cdylib"
8990cargo run --bin uniffi-bindgen generate --language kotlin \
9091 --out-dir kotlin/lib/src/main/kotlin/ --config "$UNIFFI_CONFIG" --library "$LIB"
9192mkdir -p kotlin/lib/src/main/resources/
@@ -173,6 +174,7 @@ script = '''
173174set -eu
174175command -v cargo-ndk >/dev/null 2>&1 || cargo install --version 3.5.4 cargo-ndk --locked
175176# Host lib only needed so uniffi-bindgen can read metadata.
177+ export RUSTFLAGS="--crate-type=staticlib,cdylib"
176178cargo build --lib
177179TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | python3 -c 'import json,sys;print(json.load(sys.stdin)["target_directory"])')
178180cargo ndk -o ./kotlin/lib/src/main/jniLibs \
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ export RUSTFLAGS="${RUSTFLAGS:-} \
2020 --remap-path-prefix=${CARGO_PFX} /registry=/cargo/registry \
2121 --remap-path-prefix=${CARGO_PFX} /git=/cargo/git \
2222 --remap-path-prefix=${RUSTUP_PFX} =/rustup \
23- --remap-path-prefix=${REPO_PFX} =/build"
23+ --remap-path-prefix=${REPO_PFX} =/build \
24+ --crate-type=staticlib,cdylib"
2425# --remap-path-prefix is Rust-only. Several deps (notably `ring`) compile bundled
2526# C sources via build.rs + the `cc` crate, and those object files also embed
2627# absolute source paths. `-ffile-prefix-map` is clang/gcc's analogue. The `cc`
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export MACOSX_DEPLOYMENT_TARGET="14.5"
1616TARGET_DIR=$( cargo metadata --format-version 1 --no-deps | python3 -c ' import json,sys;print(json.load(sys.stdin)["target_directory"])' )
1717
1818# Default lib (for the bindgen metadata step) + the macOS release slice.
19+ export RUSTFLAGS=" --crate-type=staticlib,cdylib"
1920cargo build --lib
2021echo " Building aarch64-apple-darwin"
2122cargo build --release --target aarch64-apple-darwin
You can’t perform that action at this time.
0 commit comments