From 037b718ae1f4846136146203732ca0f61bd7c4de Mon Sep 17 00:00:00 2001 From: Julio Gonzalez Date: Thu, 7 Nov 2024 15:29:05 +0100 Subject: [PATCH] Fix crashtracker compilation. --- builder/src/crashtracker.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/builder/src/crashtracker.rs b/builder/src/crashtracker.rs index 5bb30e49f..be2c7603b 100644 --- a/builder/src/crashtracker.rs +++ b/builder/src/crashtracker.rs @@ -20,6 +20,18 @@ pub struct CrashTracker { } impl CrashTracker { + fn gen_binaries(&self) -> Result<()> { + if arch::BUILD_CRASHTRACKER { + let mut crashtracker_dir = project_root(); + crashtracker_dir.push("crashtracker"); + let _dst = cmake::Config::new(crashtracker_dir.to_str().unwrap()) + .define("Datadog_ROOT", self.target_dir.as_ref()) + .define("CMAKE_INSTALL_PREFIX", self.target_dir.as_ref()) + .build(); + } + + Ok(()) + } fn add_headers(&self) -> Result<()> { let origin_path: PathBuf = [self.source_include.as_ref(), "crashtracker.h"] .iter() @@ -39,20 +51,12 @@ impl CrashTracker { impl Module for CrashTracker { fn build(&self) -> Result<()> { - if arch::BUILD_CRASHTRACKER { - let mut crashtracker_dir = project_root(); - crashtracker_dir.push("crashtracker"); - let _dst = cmake::Config::new(crashtracker_dir.to_str().unwrap()) - .define("Datadog_ROOT", self.target_dir.as_ref()) - .define("CMAKE_INSTALL_PREFIX", self.target_dir.as_ref()) - .build(); - } - Ok(()) } fn install(&self) -> Result<()> { self.add_headers()?; + self.gen_binaries()?; Ok(()) } }