Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc
export CC=aarch64-linux-gnu-gcc
fi
export RUSTFLAGS="--crate-type=staticlib,cdylib"
cargo build --verbose --release --target ${{matrix.cargo_target}}
- name: Build archive
shell: bash
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ name = "iroh"

[lib]
name = "iroh_ffi"
crate-type = ["staticlib", "cdylib"]

[[bin]]
name = "uniffi-bindgen"
Expand Down
2 changes: 2 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ case "$(uname -s)" in
esac
TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | python3 -c 'import json,sys;print(json.load(sys.stdin)["target_directory"])')
LIB="$TARGET_DIR/debug/${LIB_NAME}.${EXT}"
export RUSTFLAGS="--crate-type=staticlib,cdylib"
cargo run --bin uniffi-bindgen generate --language kotlin \
--out-dir kotlin/lib/src/main/kotlin/ --config "$UNIFFI_CONFIG" --library "$LIB"
mkdir -p kotlin/lib/src/main/resources/
Expand Down Expand Up @@ -173,6 +174,7 @@ script = '''
set -eu
command -v cargo-ndk >/dev/null 2>&1 || cargo install --version 3.5.4 cargo-ndk --locked
# Host lib only needed so uniffi-bindgen can read metadata.
export RUSTFLAGS="--crate-type=staticlib,cdylib"
cargo build --lib
TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | python3 -c 'import json,sys;print(json.load(sys.stdin)["target_directory"])')
cargo ndk -o ./kotlin/lib/src/main/jniLibs \
Expand Down
3 changes: 2 additions & 1 deletion make_swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export RUSTFLAGS="${RUSTFLAGS:-} \
--remap-path-prefix=${CARGO_PFX}/registry=/cargo/registry \
--remap-path-prefix=${CARGO_PFX}/git=/cargo/git \
--remap-path-prefix=${RUSTUP_PFX}=/rustup \
--remap-path-prefix=${REPO_PFX}=/build"
--remap-path-prefix=${REPO_PFX}=/build \
--crate-type=staticlib,cdylib"
# --remap-path-prefix is Rust-only. Several deps (notably `ring`) compile bundled
# C sources via build.rs + the `cc` crate, and those object files also embed
# absolute source paths. `-ffile-prefix-map` is clang/gcc's analogue. The `cc`
Expand Down
1 change: 1 addition & 0 deletions make_swift_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export MACOSX_DEPLOYMENT_TARGET="14.5"
TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | python3 -c 'import json,sys;print(json.load(sys.stdin)["target_directory"])')

# Default lib (for the bindgen metadata step) + the macOS release slice.
export RUSTFLAGS="--crate-type=staticlib,cdylib"
cargo build --lib
echo "Building aarch64-apple-darwin"
cargo build --release --target aarch64-apple-darwin
Expand Down