mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
0fee296130
This isn't linked in to anything yet, but I've verified that it works. Bug: https://github.com/dart-lang/sdk/issues/37882 Change-Id: Ib65d7f11aacac1a20d93fc5d4f10ced19ecb1e51 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113263 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Liam Appelbe <liama@google.com>
40 lines
1 KiB
Plaintext
40 lines
1 KiB
Plaintext
# 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" ]
|
|
}
|
|
}
|
|
}
|