0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 12:02:18 +02:00

Merge pull request #11 from signalapp/jrose/CARGO_BUILD_TARGET

Makefile: Respect CARGO_BUILD_TARGET for cross-compilation
This commit is contained in:
Jordan Rose 2020-10-14 11:36:48 -07:00 committed by GitHub
commit cf18ad4594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
CONFIG ?= debug
TARGET_DIR := target/$(CARGO_BUILD_TARGET)/$(CONFIG)
ifeq ($(CONFIG),debug)
CARGO_CONFIG_FLAG :=
else ifeq ($(CONFIG),release)
@ -17,15 +19,15 @@ clean:
rust: src/*.rs Cargo.toml
cargo build $(CARGO_CONFIG_FLAG)
cbindgen: target/$(CONFIG)/signal_ffi.h
cbindgen: $(TARGET_DIR)/signal_ffi.h
target/%/signal_ffi.h: signal_ffi.h
cp $^ $@
signal_ffi.h: src/*.rs Cargo.toml cbindgen.toml
rustup run nightly cbindgen -o $@
unset CARGO_BUILD_TARGET && rustup run nightly cbindgen -o $@
pkg-config: target/$(CONFIG)/signal_ffi.pc
pkg-config: $(TARGET_DIR)/signal_ffi.pc
target/%/signal_ffi.pc: signal_ffi.pc
cp $^ $@