From 46105f1d6e1ed5275e83b7d04f40154377f12275 Mon Sep 17 00:00:00 2001 From: Matias Pequeno Date: Wed, 26 Apr 2023 18:11:41 -0300 Subject: [PATCH] Only generate atos output for testing on macos --- ators/build.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ators/build.rs b/ators/build.rs index 009f7f0..bb24284 100644 --- a/ators/build.rs +++ b/ators/build.rs @@ -8,13 +8,16 @@ use std::{ process::Command, }; -const SYMBOLICATE: &str = "/usr/bin/atos"; +#[cfg(target_os = "macos")] +const ATOS: &str = "/usr/bin/atos"; + const TEST_DWARF: &str = "test.dwarf"; const TEST_ADDRS: &str = "test_addrs.txt"; const TEST_SYMR: &str = "test_symr.txt"; fn main() -> Result<()> { println!("cargo:rerun-if-changed={}", path(TEST_ADDRS)?.display()); + #[cfg(target_os = "macos")] println!("cargo:rerun-if-changed={}", path(TEST_SYMR)?.display()); path(TEST_ADDRS)? @@ -22,6 +25,7 @@ fn main() -> Result<()> { .eq(&false) .then(generate_test_addrs_file); + #[cfg(target_os = "macos")] path(TEST_SYMR)? .exists() .eq(&false) @@ -52,8 +56,9 @@ fn generate_test_addrs_file() -> Result<()> { Ok(addrs_file.flush()?) } +#[cfg(target_os = "macos")] fn generate_test_symr_file() -> Result<()> { - let output = Command::new(SYMBOLICATE) + let output = Command::new(ATOS) .args([ "-i", "-o",