.cargo/config.toml for specifying linker

To avoid code duplication we specify the linker for the specific
target armv7-unknown-linux-gnueabihf in the config.toml file as
specified here:
https://doc.rust-lang.org/cargo/reference/config.html#targettriplelinker
This commit is contained in:
Daniel Karzel 2021-03-15 13:42:21 +11:00
parent 6e09653d3f
commit f8360fe853
3 changed files with 3 additions and 6 deletions

2
.cargo/config.toml Normal file
View File

@ -0,0 +1,2 @@
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

View File

@ -64,8 +64,6 @@ jobs:
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build binary
env:
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
run: |
cargo build -p swap --target ${{ matrix.target }}
@ -100,8 +98,6 @@ jobs:
- uses: Swatinem/rust-cache@v1.2.0
- name: Build tests
env:
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
run: cargo build --tests --workspace --all-features
- name: Run monero-harness tests

View File

@ -55,8 +55,7 @@ jobs:
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build ${{ matrix.target }} ${{ matrix.bin }} release binary
env:
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
run: cargo build --target=${{ matrix.target }} --release --package swap --bin ${{ matrix.bin }}
- name: Smoke test the binary