[build] Pull cml stuff from cmx.gni to cml.gni
Change-Id: Icf28c549e42e380663afbf3d5650765ecb32a243
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/378260
Commit-Queue: Shai Barack <shayba@google.com>
Reviewed-by: Adam Barth <abarth@google.com>
diff --git a/build/cml/OWNERS b/build/cml/OWNERS
new file mode 100644
index 0000000..37e7248
--- /dev/null
+++ b/build/cml/OWNERS
@@ -0,0 +1,7 @@
+jeffbrown@google.com
+shayba@google.com
+geb@google.com
+crjohns@google.com
+bryanhenry@google.com
+
+# COMPONENT: ComponentFramework>Runtime
diff --git a/build/cml/cml.gni b/build/cml/cml.gni
new file mode 100644
index 0000000..9c0f415
--- /dev/null
+++ b/build/cml/cml.gni
@@ -0,0 +1,53 @@
+# Copyright 2018 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/compiled_action.gni")
+
+# Compiles a cml file into a cm file.
+# If is_debug is true, pretty-prints the generated cm file.
+#
+# Parameters
+#
+# data (required)
+# [file] The path to the cml file that is to be compiled.
+#
+# deps (optional)
+# public_deps (optional)
+# testonly (optional)
+# visibility (optional)
+# Standard GN meaning.
+#
+# Example of usage:
+#
+# cm(format) {
+# data = rebase_path(meta.path)
+# }
+template("cm") {
+ compiled_action(target_name) {
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "public_deps",
+ "testonly",
+ "visibility",
+ ])
+ tool = "//src/sys/cmc"
+ tool_output_name = "cmc"
+
+ compiled_output = "$target_out_dir/$target_name"
+ inputs = [ invoker.data ]
+ outputs = [ compiled_output ]
+
+ args = [
+ "compile",
+ "--output",
+ rebase_path(compiled_output),
+ invoker.data,
+ ]
+
+ if (is_debug) {
+ args += [ "--pretty" ]
+ }
+ }
+}
diff --git a/build/cmx/cmx.gni b/build/cmx/cmx.gni
index b122794..a3c1f51 100644
--- a/build/cmx/cmx.gni
+++ b/build/cmx/cmx.gni
@@ -106,56 +106,6 @@
}
}
-# Compiles a cml file
-#
-# The cm_compile template will compile a cml file into a cm file. It will
-# pretty-print the given cm file if is_debug is set to true.
-#
-# Parameters
-#
-# data (required)
-# [file] The path to the cml file that is to be compiled.
-#
-# deps (optional)
-# public_deps (optional)
-# testonly (optional)
-# visibility (optional)
-# Standard GN meaning.
-#
-# Example of usage:
-#
-# cm_compile(format) {
-# data = rebase_path(meta.path)
-# }
-template("cm_compile") {
- compiled_action(target_name) {
- forward_variables_from(invoker,
- [
- "deps",
- "public_deps",
- "testonly",
- "visibility",
- ])
- tool = "//src/sys/cmc"
- tool_output_name = "cmc"
-
- compiled_output = "$target_out_dir/$target_name"
- inputs = [ invoker.data ]
- outputs = [ compiled_output ]
-
- args = [
- "compile",
- "--output",
- rebase_path(compiled_output),
- invoker.data,
- ]
-
- if (is_debug) {
- args += [ "--pretty" ]
- }
- }
-}
-
# Merges together cmx files
#
# The cmx_merge template will combine the given cmx files into a single cmx
diff --git a/build/package.gni b/build/package.gni
index 6eaa675..446b668 100644
--- a/build/package.gni
+++ b/build/package.gni
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/cml/cml.gni")
import("//build/cmx/cmx.gni")
import("//build/compiled_action.gni")
import("//build/images/args.gni")
@@ -687,7 +688,7 @@
compiled = "compiled_" + pkg_target_name + "_" +
get_path_info(meta.dest, "file")
- cm_compile(compiled) {
+ cm(compiled) {
data = rebase_path(meta.path)
deps = pkg.deps
public_deps = pkg.public_deps
diff --git a/src/devices/bin/driver_manager/BUILD.gn b/src/devices/bin/driver_manager/BUILD.gn
index 8c4e1d9..4290ec6 100644
--- a/src/devices/bin/driver_manager/BUILD.gn
+++ b/src/devices/bin/driver_manager/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//build/cmx/cmx.gni")
+import("//build/cml/cml.gni")
import("//build/test.gni")
import("//build/test/test_package.gni")
import("//build/test/test_package.gni")
@@ -100,7 +100,7 @@
defines = [ "_ALL_SOURCE=1" ]
}
-cm_compile("driver_manager.cm") {
+cm("driver_manager.cm") {
data = rebase_path("meta/driver_manager.cml")
}
diff --git a/src/sys/bootstrap/BUILD.gn b/src/sys/bootstrap/BUILD.gn
index d948f98..152daaf 100644
--- a/src/sys/bootstrap/BUILD.gn
+++ b/src/sys/bootstrap/BUILD.gn
@@ -2,29 +2,28 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//build/cmx/cmx.gni")
+import("//build/cml/cml.gni")
import("//build/images/manifest.gni")
-cm_compile("root.cm") {
+cm("root.cm") {
data = rebase_path("meta/root.cml")
}
-cm_compile("bootstrap.cm") {
+cm("bootstrap.cm") {
data = rebase_path("meta/bootstrap.cml")
}
# TODO(BLD-448): These should move into their appropriate packages that are
-# included in bootfs along with the binaries and other resources/libraries. For
-# now they here since cm_compile doesn't exist in //zircon.
-cm_compile("console.cm") {
+# included in bootfs along with the binaries and other resources/libraries.
+cm("console.cm") {
data = rebase_path("meta/console.cml")
}
-cm_compile("ptysvc.cm") {
+cm("ptysvc.cm") {
data = rebase_path("meta/ptysvc.cml")
}
-cm_compile("sysinfo.cm") {
+cm("sysinfo.cm") {
data = rebase_path("meta/sysinfo.cml")
}
-cm_compile("fshost.cm") {
+cm("fshost.cm") {
data = rebase_path("meta/fshost.cml")
}