mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
e33d023fa0
doesn't show these formatting changes as diffs. Change-Id: I69ccbf4adabc66d88371cece785a2c1bce60f133 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138962 Reviewed-by: Ryan Macnak <rmacnak@google.com>
41 lines
1 KiB
Text
41 lines
1 KiB
Text
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
template("rust_library") {
|
|
manifest = rebase_path("Cargo.toml")
|
|
if (defined(invoker.manifest)) {
|
|
manifest = invoker.manifest
|
|
}
|
|
|
|
cmd = [
|
|
rebase_path("//buildtools/${current_os}-${current_cpu}/rust/bin/cargo"),
|
|
"build",
|
|
"--target-dir",
|
|
rebase_path(target_out_dir),
|
|
"--manifest-path",
|
|
manifest,
|
|
]
|
|
output = "$target_out_dir/lib${invoker.lib_name}.a"
|
|
debug = defined(invoker.debug) && invoker.debug
|
|
|
|
if (!debug) {
|
|
cmd += [ "--release" ]
|
|
}
|
|
|
|
action(target_name) {
|
|
script = "//build/rust/run.py"
|
|
args = cmd
|
|
outputs = [ output ]
|
|
public_configs = [ ":${target_name}_config" ]
|
|
}
|
|
|
|
config("${target_name}_config") {
|
|
libs = [ "wasmer" ]
|
|
if (debug) {
|
|
lib_dirs = [ "$target_out_dir/debug" ]
|
|
} else {
|
|
lib_dirs = [ "$target_out_dir/release" ]
|
|
}
|
|
}
|
|
}
|