Skip to content

Commit

Permalink
pw_build: Remove output_name attr in rust_library
Browse files Browse the repository at this point in the history
It is possible that multiple versions of a same crate may exist in the
dependency tree of a target. Setting output name to crate_name leads to
muliple definitions of a target in Ninja.

This change removes explicit output name. Different versions of the same
crate can use rustflags = [ "-Cextra-filename=-<id>" ] to resolve
conflict output names.

Change-Id: I0a8e806affd01e32bcba6c0d99a23adccef58cd3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230012
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Jiacheng Lu <[email protected]>
Reviewed-by: Erik Gilling <[email protected]>
Commit-Queue: Jiacheng Lu <[email protected]>
  • Loading branch information
Jason0214 authored and CQ Bot Account committed Aug 21, 2024
1 parent e224ccc commit d0655bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion pw_build/rust_library.gni
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ template("pw_rust_library") {
}

crate_name = string_replace(crate_name, "-", "_")
output_name = crate_name
output_dir = "${target_out_dir}/lib"
add_global_link_deps = true
}
Expand Down
1 change: 0 additions & 1 deletion pw_build/rust_staticlib.gni
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ template("pw_rust_static_library") {
}

crate_name = string_replace(crate_name, "-", "_")
output_name = crate_name
output_dir = "${target_out_dir}/lib"
add_global_link_deps = true
libs = [ "${output_name}" ]
Expand Down

0 comments on commit d0655bf

Please sign in to comment.