Skip to content

Commit

Permalink
Fix include directory parsing on Linux in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
alecrivers committed Dec 10, 2023
1 parent 50b5f9d commit 9664d92
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions r2r_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ pub fn setup_bindgen_builder() -> bindgen::Builder {
}

let ament_prefix_var_name = "AMENT_PREFIX_PATH";
let split_char = if cfg!(target_os = "windows") {
';'
} else {
':'
};
let ament_prefix_var = {
let mut ament_str = env::var_os(ament_prefix_var_name).expect("Source your ROS!");
if let Some(cmake_prefix_var) = env::var_os("CMAKE_PREFIX_PATH") {
ament_str.push(";");
ament_str.push(&split_char.to_string());
ament_str.push(cmake_prefix_var);
}
RawOsString::new(ament_str)
};
let split_char = if cfg!(target_os = "windows") {
';'
} else {
':'
};
for p in ament_prefix_var.split(split_char) {
let path = Path::new(&p.to_os_str()).join("include");

Expand Down

0 comments on commit 9664d92

Please sign in to comment.