aboutsummaryrefslogtreecommitdiff
path: root/osp
diff options
context:
space:
mode:
authorbtolsch <btolsch@chromium.org>2019-08-20 13:01:05 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-20 20:09:03 +0000
commit4ca3339848cc889648ba6c70edfbef944cdf1ffb (patch)
treebde480ea8203c47dd47e0e07bc632f51b733c471 /osp
parent3add518d1ec32195ae6ffdca264978253177233e (diff)
downloadopenscreen-4ca3339848cc889648ba6c70edfbef944cdf1ffb.tar.gz
Enforce host toolchain for cddl and protoc tools
This change helps people who are cross-compiling by ensuring that the cddl and protoc tools are only ever compiled with the host toolchain. Bug: 981676 Change-Id: I8999764e9913a78b116d6ec3ced5b31c77c83604 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/1759283 Commit-Queue: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: Max Yakimakha <yakimakha@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
Diffstat (limited to 'osp')
-rw-r--r--osp/msgs/BUILD.gn30
1 files changed, 19 insertions, 11 deletions
diff --git a/osp/msgs/BUILD.gn b/osp/msgs/BUILD.gn
index 324e838d..898ce915 100644
--- a/osp/msgs/BUILD.gn
+++ b/osp/msgs/BUILD.gn
@@ -40,19 +40,27 @@ action("cddl_gen") {
outputs += [ root_gen_dir + "/" + o ]
}
- args = [
- "--header",
- outputs_src[0],
- "--cc",
- outputs_src[1],
- "--gen-dir",
- rebase_path(root_gen_dir, root_build_dir),
- "--log",
- rebase_path("cddl.log", "//"),
- ] + rebase_path(sources, root_build_dir)
+ cddl_label = "../../tools/cddl:cddl($host_toolchain)"
+ cddl_path = get_label_info(cddl_label, "root_out_dir") + "/cddl"
+ args =
+ [
+ "--cddl",
+
+ # Path should be rebased because |root_build_dir| for current toolchain
+ # may be different from |root_out_dir| of cddl built on host toolchain.
+ "./" + rebase_path(cddl_path, root_build_dir),
+ "--header",
+ outputs_src[0],
+ "--cc",
+ outputs_src[1],
+ "--gen-dir",
+ rebase_path(root_gen_dir, root_build_dir),
+ "--log",
+ rebase_path("cddl.log", "//"),
+ ] + rebase_path(sources, root_build_dir)
deps = [
- "../../tools/cddl",
+ cddl_label,
]
}