Skip to content

Commit

Permalink
Relies on BCR for maliput_malidrive binaries.
Browse files Browse the repository at this point in the history
Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com>
  • Loading branch information
francocipollone committed Feb 2, 2024
1 parent 7e4924b commit 2caf015
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
1 change: 1 addition & 0 deletions maliput-sdk/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cc_binary(
"@maliput//:geometry_base",
"@maliput//:plugin",
"@maliput//:utility",
"@maliput_malidrive//:maliput_plugins/libmaliput_malidrive_road_network.so",
],
linkshared = True,
linkstatic = False
Expand Down
1 change: 1 addition & 0 deletions maliput-sdk/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ module(

bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "maliput", version = "1.2.0")
bazel_dep(name = "maliput_malidrive", version = "0.2.1")
23 changes: 4 additions & 19 deletions maliput-sdk/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,13 @@ fn main() -> Result<(), Box<dyn Error>> {
}
let bazel_bin_dir = bazel_output_base_dir.join("bazel-bin");


// TODO(francocipollone): Remove this custom build once maliput_malidrive is within BCR.
env::set_current_dir("maliput_malidrive")
.unwrap_or_else(|_| panic!("Unable to change directory to {}", "maliput_malidrive"));
let build_malidrive = std::process::Command::new("bazel")
.arg("build")
.arg("//...")
.status()
.expect("Failed to generate build script");
if build_malidrive.code() != Some(0) {
panic!("Failed to generate build script");
}
let maliput_malidrive_bin_path = PathBuf::from(env::current_dir().unwrap()).join("bazel-bin");

// ************* maliput header files ************* //

// TODO(francocipollone): Get version from MODULE.bazel configuration.
let maliput_version = "1.2.0";
let maliput_bin_path = bazel_bin_dir.join("external").join(format!("maliput~{}", maliput_version));
let maliput_malidrive_version: &str = "0.2.1";
let maliput_malidrive_bin_path = bazel_bin_dir.join("external").join(format!("maliput_malidrive~{}", maliput_malidrive_version));

// ************* maliput header files ************* //

//---Header files---
let virtual_includes_path = maliput_bin_path.join("_virtual_includes");
Expand Down Expand Up @@ -107,9 +95,6 @@ fn main() -> Result<(), Box<dyn Error>> {
println!("cargo:maliput_malidrive_plugin_path={}",
maliput_malidrive_bin_path
.join("maliput_plugins")
.join("libmaliput_malidrive_road_network.so.runfiles")
.join("_main")
.join("maliput_plugins")
.display()); //> Accessed as MALIPUT_SDK_MALIPUT_MALIDRIVE_PLUGIN_PATH

Ok(())
Expand Down

0 comments on commit 2caf015

Please sign in to comment.