HomePhabricator

[CMAKE] Use the crosscompiling emulator to run the tests

Description

[CMAKE] Use the crosscompiling emulator to run the tests

Summary:
This makes the test_bitcoin check targets honor the
CMAKE_CROSSCOMPILER_EMULATOR if given. This is useful for running the
ARM/AArch64 binaries with qemu.

Test Plan:
Prerequisite

sudo apt install qemu-user-static

Then:

cmake -GNinja .. \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/LinuxAArch64.cmake \
  -DCMAKE_CROSSCOMPILING_EMULATOR=$(command -v qemu-aarch64-static)
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu ninja check-bitcoin

Sanity check for regression:

cmake -GNinja ..
ninja check

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5877

Details

Provenance
FabienAuthored on Apr 29 2020, 10:18
FabienPushed on Apr 29 2020, 13:04
Reviewer
Restricted Project
Differential Revision
D5877: [CMAKE] Use the crosscompiling emulator to run the tests
Parents
rSTAGING5e74490cca48: [CMAKE] Propagate the LFS support flags to the libraries
Branches
Unknown
Tags
Unknown