Skip to content

Commit 4e546cd

Browse files
authored
Merge pull request #71 from alecrivers/fix-include-directories
Fix include directory parsing on Linux in some cases
2 parents 50b5f9d + 9664d92 commit 4e546cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

r2r_common/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ pub fn setup_bindgen_builder() -> bindgen::Builder {
6363
}
6464

6565
let ament_prefix_var_name = "AMENT_PREFIX_PATH";
66+
let split_char = if cfg!(target_os = "windows") {
67+
';'
68+
} else {
69+
':'
70+
};
6671
let ament_prefix_var = {
6772
let mut ament_str = env::var_os(ament_prefix_var_name).expect("Source your ROS!");
6873
if let Some(cmake_prefix_var) = env::var_os("CMAKE_PREFIX_PATH") {
69-
ament_str.push(";");
74+
ament_str.push(&split_char.to_string());
7075
ament_str.push(cmake_prefix_var);
7176
}
7277
RawOsString::new(ament_str)
7378
};
74-
let split_char = if cfg!(target_os = "windows") {
75-
';'
76-
} else {
77-
':'
78-
};
7979
for p in ament_prefix_var.split(split_char) {
8080
let path = Path::new(&p.to_os_str()).join("include");
8181

0 commit comments

Comments
 (0)