OLD | NEW |
1 # Copyright 2015 The Native Client Authors. All rights reserved. | 1 # Copyright 2015 The Native Client 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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
7 | 7 |
8 # Generate a nmf file | 8 # Generate a nmf file |
9 # | 9 # |
10 # Native Client Manifest (nmf) is a JSON file that tells the browser where to | 10 # Native Client Manifest (nmf) is a JSON file that tells the browser where to |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 # Generate a nmf file for Non-SFI tests | 108 # Generate a nmf file for Non-SFI tests |
109 # | 109 # |
110 # Non-SFI tests use a different manifest format from regular Native Client and | 110 # Non-SFI tests use a different manifest format from regular Native Client and |
111 # as such requires a different generator. | 111 # as such requires a different generator. |
112 # | 112 # |
113 # Variables: | 113 # Variables: |
114 # executable: Non-SFI .nexe executable to generate nmf for | 114 # executable: Non-SFI .nexe executable to generate nmf for |
115 # nmf: the name and the path of the output file | 115 # nmf: the name and the path of the output file |
| 116 # nmfflags: additional flags for the nmf generator |
116 template("generate_nonsfi_test_nmf") { | 117 template("generate_nonsfi_test_nmf") { |
117 assert(defined(invoker.executable), "Must define executable") | 118 assert(defined(invoker.executable), "Must define executable") |
118 assert(defined(invoker.nmf), "Must define nmf") | 119 assert(defined(invoker.nmf), "Must define nmf") |
119 | 120 |
120 action(target_name) { | 121 action(target_name) { |
| 122 nmfflags = [] |
| 123 |
121 forward_variables_from(invoker, | 124 forward_variables_from(invoker, |
122 [ | 125 [ |
123 "deps", | 126 "deps", |
124 "data_deps", | 127 "data_deps", |
125 "executable", | 128 "executable", |
126 "nmf", | 129 "nmf", |
| 130 "nmfflags", |
127 "testonly", | 131 "testonly", |
128 "public_deps", | 132 "public_deps", |
129 ]) | 133 ]) |
130 | 134 |
131 script = "//ppapi/tests/create_nonsfi_test_nmf.py" | 135 script = "//ppapi/tests/create_nonsfi_test_nmf.py" |
132 sources = [ | 136 sources = [ |
133 executable, | 137 executable, |
134 ] | 138 ] |
135 outputs = [ | 139 outputs = [ |
136 nmf, | 140 nmf, |
137 ] | 141 ] |
138 | 142 |
139 # NOTE: We use target_cpu rather than current_cpu on purpose because | 143 # NOTE: We use target_cpu rather than current_cpu on purpose because |
140 # current_cpu is always going to be pnacl for Non-SFI, but the Non-SFI | 144 # current_cpu is always going to be pnacl for Non-SFI, but the Non-SFI |
141 # .nexe executable is always translated to run on the target machine. | 145 # .nexe executable is always translated to run on the target machine. |
142 if (target_cpu == "x86") { | 146 if (target_cpu == "x86") { |
143 arch = "x86-32" | 147 arch = "x86-32" |
144 } else if (target_cpu == "x64") { | 148 } else if (target_cpu == "x64") { |
145 arch = "x86-64" | 149 arch = "x86-64" |
146 } else { | 150 } else { |
147 arch = target_cpu | 151 arch = target_cpu |
148 } | 152 } |
149 args = [ | 153 args = [ |
150 "--program=" + rebase_path(executable, root_build_dir), | 154 "--program=" + rebase_path(executable, root_build_dir), |
151 "--arch=${arch}", | 155 "--arch=${arch}", |
152 "--output=" + rebase_path(nmf, root_build_dir), | 156 "--output=" + rebase_path(nmf, root_build_dir), |
153 ] | 157 ] + nmfflags |
154 } | 158 } |
155 } | 159 } |
OLD | NEW |