Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2097)

Unified Diff: build/win/message_compiler.gni

Issue 1440693003: Unify mc.exe calling in GN, set environment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/etw_manifest/BUILD/message_compiler.py ('k') | build/win/message_compiler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/win/message_compiler.gni
diff --git a/build/win/message_compiler.gni b/build/win/message_compiler.gni
new file mode 100644
index 0000000000000000000000000000000000000000..1214898a0bd150729df3014c24b16ae1ea51c522
--- /dev/null
+++ b/build/win/message_compiler.gni
@@ -0,0 +1,71 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+assert(is_win, "This only runs on Windows.")
+
+# Runs mc.exe over a list of sources. The outputs (a header and rc file) are
+# placed in the target gen dir, and compiled.
+#
+# sources
+# List of message files to process.
+#
+# user_mode_logging (optional bool)
+# Generates user-mode logging code. Defaults to false (no logging code).
+#
+# deps, public_deps, visibility
+# Normal meaning.
+template("message_compiler") {
+ action_name = "${target_name}_mc"
+ source_set_name = target_name
+
+ action_foreach(action_name) {
+ visibility = [ ":$source_set_name" ]
+
+ script = "//build/win/message_compiler.py"
+
+ outputs = [
+ "$target_gen_dir/{{source_name_part}}.h",
+ "$target_gen_dir/{{source_name_part}}.rc",
+ ]
+
+ args = [
+ # The first argument is the environment file saved to the build
+ # directory. This is required because the Windows toolchain setup saves
+ # the VC paths and such so that running "mc.exe" will work with the
+ # configured toolchain. This file is in the root build dir.
+ "environment.$current_cpu",
+
+ # Where to put the header.
+ "-h",
+ rebase_path(target_gen_dir, root_build_dir),
+
+ # Where to put the .rc file.
+ "-r",
+ rebase_path(target_gen_dir, root_build_dir),
+
+ # Input is Unicode.
+ "-u",
+ ]
+ if (defined(invoker.user_mode_logging) && invoker.user_mode_logging) {
+ args += [ "-um" ]
+ }
+ args += [ "{{source}}" ]
+
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "public_deps",
+ "sources",
+ ])
+ }
+
+ # Compile the generated rc file.
+ source_set(source_set_name) {
+ forward_variables_from(invoker, [ "visibility" ])
+ sources = get_target_outputs(":$action_name")
+ deps = [
+ ":$action_name",
+ ]
+ }
+}
« no previous file with comments | « base/trace_event/etw_manifest/BUILD/message_compiler.py ('k') | build/win/message_compiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698