diff --git a/.buildkite/custom-tests.json b/.buildkite/custom-tests.json index c00d988..ae30790 100644 --- a/.buildkite/custom-tests.json +++ b/.buildkite/custom-tests.json @@ -2,21 +2,21 @@ "tests": [ { "test_name": "build-gnu-bzimage", - "command": "cargo build --release --features bzimage", + "command": "cargo build --release --features bzimage --all-targets", "platform": [ "x86_64" ] }, { "test_name": "build-musl-bzimage", - "command": "cargo build --release --features bzimage --target {target_platform}-unknown-linux-musl", + "command": "cargo build --release --features bzimage --target {target_platform}-unknown-linux-musl --all-targets", "platform": [ "x86_64" ] }, { "test_name": "build-no-default-features", - "command": "cargo build --release --no-default-features", + "command": "cargo build --release --no-default-features --all-targets", "platform": [ "x86_64", "aarch64" diff --git a/benches/fdt.rs b/benches/fdt.rs index 8e46c6b..8187824 100644 --- a/benches/fdt.rs +++ b/benches/fdt.rs @@ -4,6 +4,9 @@ // found in the LICENSE-BSD-3-Clause file. // // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +#![cfg(any(feature = "elf", feature = "pe", feature = "bzimage"))] + extern crate criterion; extern crate linux_loader; extern crate vm_memory; diff --git a/benches/main.rs b/benches/main.rs index acc435c..f4c76e3 100644 --- a/benches/main.rs +++ b/benches/main.rs @@ -11,16 +11,32 @@ extern crate vm_memory; use criterion::{criterion_group, criterion_main, Criterion}; -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + any(feature = "elf", feature = "pe", feature = "bzimage") +))] mod x86_64; -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + any(feature = "elf", feature = "pe", feature = "bzimage") +))] use x86_64::*; -#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] +#[cfg(all( + any(target_arch = "aarch64", target_arch = "riscv64"), + any(feature = "elf", feature = "pe", feature = "bzimage") +))] mod fdt; -#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] +#[cfg(all( + any(target_arch = "aarch64", target_arch = "riscv64"), + any(feature = "elf", feature = "pe", feature = "bzimage") +))] pub use fdt::*; +// No-op benchmark when configurator module is not available +#[cfg(not(any(feature = "elf", feature = "pe", feature = "bzimage")))] +fn criterion_benchmark(_c: &mut Criterion) {} + criterion_group! { name = benches; config = Criterion::default().sample_size(500); diff --git a/benches/x86_64/mod.rs b/benches/x86_64/mod.rs index 9cfa5c0..0697b70 100644 --- a/benches/x86_64/mod.rs +++ b/benches/x86_64/mod.rs @@ -6,6 +6,7 @@ // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#![cfg(any(feature = "elf", feature = "pe", feature = "bzimage"))] extern crate linux_loader; extern crate vm_memory;