Skip to content

Commit

Permalink
Update Mac build for crate location changes.
Browse files Browse the repository at this point in the history
A recent CL altered location of Rust build outputs on Linux only.
Mac builds do not work unless we add corresponding changes.

Bug: 1296669
Change-Id: I405a028b9488563ee8cd24eae922396f01e8c4f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3522635
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Adrian Taylor <adetaylor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980832}
  • Loading branch information
adetaylor authored and Chromium LUCI CQ committed Mar 14, 2022
1 parent aa5e512 commit b2f6362
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions build/toolchain/apple/toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ template("apple_toolchain") {
# However, it seems -fuse-ld=lld causes difficulties.

tool("rust_staticlib") {
rust_outfile = "{{target_out_dir}}/{{crate_name}}.a"
rust_outfile = "{{output_dir}}/{{target_output_name}}.a"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand All @@ -241,7 +241,7 @@ template("apple_toolchain") {
}

tool("rust_rlib") {
rust_outfile = "{{target_out_dir}}/lib{{crate_name}}.rlib"
rust_outfile = "{{output_dir}}/lib{{target_output_name}}.rlib"
depfile = "{{output}}.d"

# Do not use rsp files in this (common) case because they occupy the
Expand All @@ -255,7 +255,7 @@ template("apple_toolchain") {

if (toolchain_args.rustc_can_link) {
tool("rust_bin") {
rust_outfile = "{{root_out_dir}}/{{crate_name}}"
rust_outfile = "{{root_out_dir}}/{{target_output_name}}"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand All @@ -266,7 +266,7 @@ template("apple_toolchain") {
}

tool("rust_cdylib") {
rust_outfile = "{{target_out_dir}}/lib{{crate_name}}.dylib"
rust_outfile = "{{output_dir}}/lib{{target_output_name}}.dylib"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand All @@ -277,7 +277,7 @@ template("apple_toolchain") {
}

tool("rust_macro") {
rust_outfile = "{{target_out_dir}}/lib{{crate_name}}.dylib"
rust_outfile = "{{output_dir}}/lib{{target_output_name}}.dylib"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand Down
11 changes: 6 additions & 5 deletions build/toolchain/win/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ template("msvc_toolchain") {
rustc = rebase_path("${rust_sysroot}/bin/rustc", root_build_dir)
rust_sysroot_relative_to_out = rebase_path(rust_sysroot, root_out_dir)
tool("rust_staticlib") {
rust_outfile = "{{target_out_dir}}/{{crate_name}}.lib"
rust_outfile = "{{output_dir}}/{{target_output_name}}.lib"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand All @@ -318,8 +318,9 @@ template("msvc_toolchain") {
}

tool("rust_rlib") {
rust_outfile = "{{target_out_dir}}/lib{{crate_name}}.rlib"
rust_outfile = "{{output_dir}}/lib{{target_output_name}}.rlib"
depfile = "{{output}}.d"

# Do not use rsp files in this (common) case because they occupy the
# ninja main thread, and {{rlibs}} have shorter command lines than
# fully linked targets.
Expand All @@ -331,7 +332,7 @@ template("msvc_toolchain") {

if (toolchain_args.rustc_can_link) {
tool("rust_bin") {
rust_outfile = "{{root_out_dir}}/{{crate_name}}.exe"
rust_outfile = "{{root_out_dir}}/{{target_output_name}}.exe"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand All @@ -342,7 +343,7 @@ template("msvc_toolchain") {
}

tool("rust_cdylib") {
rust_outfile = "{{target_out_dir}}/lib{{crate_name}}.dll"
rust_outfile = "{{output_dir}}/lib{{target_output_name}}.dll"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand All @@ -353,7 +354,7 @@ template("msvc_toolchain") {
}

tool("rust_macro") {
rust_outfile = "{{target_out_dir}}/{{crate_name}}.dll"
rust_outfile = "{{output_dir}}/{{target_output_name}}.dll"
depfile = "{{output}}.d"
rspfile = "$rust_outfile.rsp"
rspfile_content = "{{rustdeps}} {{externs}}"
Expand Down

0 comments on commit b2f6362

Please sign in to comment.