|
1 | 1 | load( |
2 | 2 | ":build_defs.bzl", |
| 3 | + "build_rust_cmd", |
3 | 4 | "CLDEBUGINFO100_GRAMMAR_JSON_FILE", |
4 | 5 | "COMMON_COPTS", |
5 | 6 | "DEBUGINFO_GRAMMAR_JSON_FILE", |
@@ -35,15 +36,6 @@ config_setting( |
35 | 36 | define_values = {"spirv_tools_rust_profile": "debug"}, |
36 | 37 | ) |
37 | 38 |
|
38 | | - |
39 | | -def _build_rust_cmd(profile): |
40 | | - return ( |
41 | | - "$(location :build_rust_ffi) " + |
42 | | - "--manifest-path $(location rust/Cargo.toml) " + |
43 | | - "--profile {profile} --target-dir $(@D)/cargo --output $@" |
44 | | - ).format(profile = profile) |
45 | | - |
46 | | - |
47 | 39 | py_binary( |
48 | 40 | name = "build_rust_ffi", |
49 | 41 | srcs = ["rust/scripts/build_rust_ffi.py"], |
@@ -152,12 +144,12 @@ genrule( |
152 | 144 | ), |
153 | 145 | outs = ["rust/libspirv_tools_ffi.a"], |
154 | 146 | cmd = select({ |
155 | | - "//:spirv_rust_profile_debug": _build_rust_cmd("debug"), |
156 | | - "//conditions:default": _build_rust_cmd("release"), |
| 147 | + "//:spirv_rust_profile_debug": build_rust_cmd("debug"), |
| 148 | + "//conditions:default": build_rust_cmd("release"), |
157 | 149 | }), |
158 | 150 | cmd_bat = select({ |
159 | | - "//:spirv_rust_profile_debug": _build_rust_cmd("debug"), |
160 | | - "//conditions:default": _build_rust_cmd("release"), |
| 151 | + "//:spirv_rust_profile_debug": build_rust_cmd("debug"), |
| 152 | + "//conditions:default": build_rust_cmd("release"), |
161 | 153 | }), |
162 | 154 | tools = [":build_rust_ffi"], |
163 | 155 | tags = ["requires-cargo"], |
|
0 commit comments