diff --git a/CMakeLists.txt b/CMakeLists.txt index be6d1d1cf..7358b89c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ FetchContent_Declare( FetchContent_MakeAvailable(absl) -include_directories(${CMAKE_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(CRUBIT_SUBDIRS support diff --git a/cc_bindings_from_rs/cargo-cpp_api_from_rust.rs b/cc_bindings_from_rs/cargo-cpp_api_from_rust.rs index 5a07ff17a..1280581f3 100644 --- a/cc_bindings_from_rs/cargo-cpp_api_from_rust.rs +++ b/cc_bindings_from_rs/cargo-cpp_api_from_rust.rs @@ -137,8 +137,9 @@ fn main() -> Result<()> { profile_dir = filename .strip_prefix(&target_dir) .ok() - .and_then(|path| path.components().next()) - .map(|component| component.as_str().to_owned()); + // Remove the filename from the path. + .and_then(|path| path.parent()) + .map(|path| path.to_owned()); source_crate_rlib = artifact .filenames .iter()