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

Side by Side Diff: build/win/message_compiler.gni

Issue 1528093003: Disable etw_manifest in the GN Windows build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: generate but don't compile Created 5 years 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.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 assert(is_win, "This only runs on Windows.") 5 assert(is_win, "This only runs on Windows.")
6 6
7 # Runs mc.exe over a list of sources. The outputs (a header and rc file) are 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. 8 # placed in the target gen dir, and compiled.
9 # 9 #
10 # sources 10 # sources
11 # List of message files to process. 11 # List of message files to process.
12 # 12 #
13 # user_mode_logging (optional bool) 13 # user_mode_logging (optional bool)
14 # Generates user-mode logging code. Defaults to false (no logging code). 14 # Generates user-mode logging code. Defaults to false (no logging code).
15 # 15 #
16 # compile_generated_code (optional, deafults = true)
17 # If unset or true, the generated code will be compiled and linked into
18 # targets that depend on it. If set to false, the .h and .rc files will only
19 # be generated.
20 #
16 # deps, public_deps, visibility 21 # deps, public_deps, visibility
17 # Normal meaning. 22 # Normal meaning.
18 template("message_compiler") { 23 template("message_compiler") {
19 action_name = "${target_name}_mc" 24 if (defined(invoker.compile_generated_code) &&
20 source_set_name = target_name 25 !invoker.compile_generated_code) {
26 compile_generated_code = false
27 action_name = target_name
28 } else {
29 compile_generated_code = true
30 action_name = "${target_name}_mc"
31 source_set_name = target_name
32 }
21 33
22 action_foreach(action_name) { 34 action_foreach(action_name) {
23 visibility = [ ":$source_set_name" ] 35 if (compile_generated_code) {
36 visibility = [ ":$source_set_name" ]
37 } else {
38 forward_variables_from(invoker, [ "visibility" ])
39 }
24 40
25 script = "//build/win/message_compiler.py" 41 script = "//build/win/message_compiler.py"
26 42
27 outputs = [ 43 outputs = [
28 "$target_gen_dir/{{source_name_part}}.h", 44 "$target_gen_dir/{{source_name_part}}.h",
29 "$target_gen_dir/{{source_name_part}}.rc", 45 "$target_gen_dir/{{source_name_part}}.rc",
30 ] 46 ]
31 47
32 args = [ 48 args = [
33 # The first argument is the environment file saved to the build 49 # The first argument is the environment file saved to the build
(...skipping 19 matching lines...) Expand all
53 args += [ "{{source}}" ] 69 args += [ "{{source}}" ]
54 70
55 forward_variables_from(invoker, 71 forward_variables_from(invoker,
56 [ 72 [
57 "deps", 73 "deps",
58 "public_deps", 74 "public_deps",
59 "sources", 75 "sources",
60 ]) 76 ])
61 } 77 }
62 78
63 # Compile the generated rc file. 79 if (compile_generated_code) {
64 source_set(source_set_name) { 80 # Compile the generated rc file.
65 forward_variables_from(invoker, [ "visibility" ]) 81 source_set(source_set_name) {
66 sources = get_target_outputs(":$action_name") 82 forward_variables_from(invoker, [ "visibility" ])
67 deps = [ 83 sources = get_target_outputs(":$action_name")
68 ":$action_name", 84 deps = [
69 ] 85 ":$action_name",
86 ]
87 }
70 } 88 }
71 } 89 }
OLDNEW
« no previous file with comments | « base/trace_event/etw_manifest/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698