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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 assert(is_win, "This only runs on Windows.")
6
7 # Runs mc.exe over a list of sources. The outputs (a header and rc file) are
8 # placed in the target gen dir, and compiled.
9 #
10 # sources
11 # List of message files to process.
12 #
13 # user_mode_logging (optional bool)
14 # Generates user-mode logging code. Defaults to false (no logging code).
15 #
16 # deps, public_deps, visibility
17 # Normal meaning.
18 template("message_compiler") {
19 action_name = "${target_name}_mc"
20 source_set_name = target_name
21
22 action_foreach(action_name) {
23 visibility = [ ":$source_set_name" ]
24
25 script = "//build/win/message_compiler.py"
26
27 outputs = [
28 "$target_gen_dir/{{source_name_part}}.h",
29 "$target_gen_dir/{{source_name_part}}.rc",
30 ]
31
32 args = [
33 # The first argument is the environment file saved to the build
34 # directory. This is required because the Windows toolchain setup saves
35 # the VC paths and such so that running "mc.exe" will work with the
36 # configured toolchain. This file is in the root build dir.
37 "environment.$current_cpu",
38
39 # Where to put the header.
40 "-h",
41 rebase_path(target_gen_dir, root_build_dir),
42
43 # Where to put the .rc file.
44 "-r",
45 rebase_path(target_gen_dir, root_build_dir),
46
47 # Input is Unicode.
48 "-u",
49 ]
50 if (defined(invoker.user_mode_logging) && invoker.user_mode_logging) {
51 args += [ "-um" ]
52 }
53 args += [ "{{source}}" ]
54
55 forward_variables_from(invoker,
56 [
57 "deps",
58 "public_deps",
59 "sources",
60 ])
61 }
62
63 # Compile the generated rc file.
64 source_set(source_set_name) {
65 forward_variables_from(invoker, [ "visibility" ])
66 sources = get_target_outputs(":$action_name")
67 deps = [
68 ":$action_name",
69 ]
70 }
71 }
OLDNEW
« 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