|
3 | 3 |
|
4 | 4 | use crate::arch; |
5 | 5 | use crate::module::Module; |
6 | | -use crate::utils::{adjust_extern_symbols, file_replace, project_root, wait_for_success}; |
| 6 | +use crate::utils::{adjust_extern_symbols, project_root, wait_for_success}; |
7 | 7 | use anyhow::Result; |
8 | 8 | use serde::Deserialize; |
9 | 9 | use std::ffi::OsStr; |
@@ -118,46 +118,11 @@ impl Profiling { |
118 | 118 | } |
119 | 119 |
|
120 | 120 | fn add_pkg_config(&self) -> Result<()> { |
121 | | - #[cfg(target_os = "windows")] |
122 | | - return Ok(()); |
123 | | - |
124 | | - let files: [&str; 3] = [ |
125 | | - "datadog_profiling.pc", |
126 | | - "datadog_profiling_with_rpath.pc", |
127 | | - "datadog_profiling-static.pc", |
128 | | - ]; |
129 | | - |
130 | | - //Create directory |
131 | | - let pc_dir = Path::new(self.target_pkconfig.as_ref()); |
132 | | - fs::create_dir_all(pc_dir).expect("Failed to create pkgconfig directory"); |
133 | | - |
134 | | - // Create files |
135 | | - for file in files.iter() { |
136 | | - let file_in = file.to_string() + ".in"; |
137 | | - |
138 | | - let mut pc_origin: PathBuf = project_root(); |
139 | | - pc_origin.push(CRATE_FOLDER); |
140 | | - pc_origin.push(file_in); |
141 | | - |
142 | | - let pc_target: PathBuf = [pc_dir.as_os_str(), OsStr::new(file)].iter().collect(); |
143 | | - |
144 | | - file_replace( |
145 | | - pc_origin.to_str().unwrap(), |
146 | | - pc_target.to_str().unwrap(), |
147 | | - "@Datadog_VERSION@", |
148 | | - &self.version, |
149 | | - )?; |
150 | | - |
151 | | - if *file == files[2] { |
152 | | - file_replace( |
153 | | - pc_origin.to_str().unwrap(), |
154 | | - pc_target.to_str().unwrap(), |
155 | | - "@Datadog_LIBRARIES@", |
156 | | - arch::NATIVE_LIBS, |
157 | | - )?; |
158 | | - } |
159 | | - } |
160 | | - Ok(()) |
| 121 | + arch::add_pkg_config( |
| 122 | + CRATE_FOLDER, |
| 123 | + self.target_pkconfig.as_ref(), |
| 124 | + self.version.as_ref(), |
| 125 | + ) |
161 | 126 | } |
162 | 127 | } |
163 | 128 |
|
|
0 commit comments