Skip to content

Commit 0048722

Browse files
authored
Merge pull request #182 from yusdacra/fix/dependency-detection
fix: also check cfg gated target field for bootloader dependency
2 parents a777e0b + a5f057c commit 0048722

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: build.rs

+7
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ mod binary {
243243
if manifest
244244
.get("dependencies")
245245
.and_then(|d| d.get("bootloader"))
246+
.or_else(|| {
247+
manifest
248+
.get("target")
249+
.and_then(|table| table.get(r#"cfg(target_arch = "x86_64")"#))
250+
.and_then(|table| table.get("dependencies"))
251+
.and_then(|table| table.get("bootloader"))
252+
})
246253
.is_some()
247254
{
248255
// it seems to be the correct Cargo.toml

Diff for: tests/test_kernels/map_phys_mem/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Philipp Oppermann <[email protected]>"]
55
edition = "2018"
66

7-
[dependencies]
7+
[target.'cfg(target_arch = "x86_64")'.dependencies]
88
bootloader = { path = "../../.." }
99
x86_64 = { version = "0.13.2", default-features = false, features = ["instructions", "inline_asm"] }
1010
uart_16550 = "0.2.10"

0 commit comments

Comments
 (0)