OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 copy("copy_test_files") { | 5 copy("copy_test_files") { |
6 visibility = [ ":*" ] | 6 visibility = [ ":*" ] |
7 sources = [ | 7 sources = [ |
8 # Keep "test_case.html.mock-http-headers" with "test_case.html". | 8 # Keep "test_case.html.mock-http-headers" with "test_case.html". |
9 "tests/ppapi_nacl_tests_newlib.nmf", | 9 "tests/ppapi_nacl_tests_newlib.nmf", |
10 "tests/test_case.html", | 10 "tests/test_case.html", |
(...skipping 10 matching lines...) Expand all Loading... | |
21 visibility = [ ":*" ] | 21 visibility = [ ":*" ] |
22 sources = [ | 22 sources = [ |
23 "tests/test_url_loader_data/hello.txt", | 23 "tests/test_url_loader_data/hello.txt", |
24 ] | 24 ] |
25 outputs = [ | 25 outputs = [ |
26 "$root_out_dir/test_url_loader_data/{{source_file_part}}", | 26 "$root_out_dir/test_url_loader_data/{{source_file_part}}", |
27 ] | 27 ] |
28 } | 28 } |
29 | 29 |
30 import("//build/config/features.gni") | 30 import("//build/config/features.gni") |
31 import("//build/config/nacl/config.gni") | |
31 import("//ppapi/ppapi_sources.gni") | 32 import("//ppapi/ppapi_sources.gni") |
32 import("//testing/test.gni") | 33 import("//testing/test.gni") |
33 | 34 |
34 shared_library("ppapi_tests") { | 35 shared_library("ppapi_tests") { |
35 sources = ppapi_sources.test_common_source_files + | 36 sources = ppapi_sources.test_common_source_files + |
36 ppapi_sources.test_trusted_source_files | 37 ppapi_sources.test_trusted_source_files |
37 | 38 |
38 configs += [ "//build/config:precompiled_headers" ] | 39 configs += [ "//build/config:precompiled_headers" ] |
39 defines = [ "GL_GLEXT_PROTOTYPES" ] | 40 defines = [ "GL_GLEXT_PROTOTYPES" ] |
40 include_dirs = [ "lib/gl/include" ] | 41 include_dirs = [ "lib/gl/include" ] |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 "tools/pepper_hash_for_uma.cc", | 139 "tools/pepper_hash_for_uma.cc", |
139 ] | 140 ] |
140 | 141 |
141 deps = [ | 142 deps = [ |
142 "//base", | 143 "//base", |
143 "//build/config/sanitizers:deps", | 144 "//build/config/sanitizers:deps", |
144 ] | 145 ] |
145 } | 146 } |
146 | 147 |
147 source_set("ppapi_cpp_lib") { | 148 source_set("ppapi_cpp_lib") { |
149 if (is_posix) { | |
150 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |
Roland McGrath
2015/09/14 20:19:51
Why? I don't see why this is needed. There shoul
Petr Hosek
2015/09/14 23:50:44
Done.
| |
151 } | |
148 sources = ppapi_sources.cpp_source_files | 152 sources = ppapi_sources.cpp_source_files |
149 sources += [ | 153 sources += [ |
150 "cpp/module_embedder.h", | 154 "cpp/module_embedder.h", |
151 "cpp/ppp_entrypoints.cc", | 155 "cpp/ppp_entrypoints.cc", |
152 ] | 156 ] |
157 if (is_nacl) { | |
158 cflags = [ "-fPIC" ] | |
Roland McGrath
2015/09/14 20:19:51
This really does not seem like it belongs here. Y
Petr Hosek
2015/09/14 23:50:44
Is there a clean way to check whether the source s
| |
159 } | |
160 deps = [ | |
161 "//build/config/nacl:nacl_base", | |
162 ] | |
153 } | 163 } |
154 | 164 |
155 source_set("ppapi_gles2_lib") { | 165 source_set("ppapi_gles2_lib") { |
156 include_dirs = [ "lib/gl/include" ] | 166 include_dirs = [ "lib/gl/include" ] |
157 sources = [ | 167 sources = [ |
158 "lib/gl/gles2/gl2ext_ppapi.c", | 168 "lib/gl/gles2/gl2ext_ppapi.c", |
159 "lib/gl/gles2/gl2ext_ppapi.h", | 169 "lib/gl/gles2/gl2ext_ppapi.h", |
160 "lib/gl/gles2/gles2.c", | 170 "lib/gl/gles2/gles2.c", |
161 ] | 171 ] |
162 deps = [ | 172 deps = [ |
163 "//ppapi/cpp", | 173 "//ppapi/cpp", |
164 ] | 174 ] |
165 } | 175 } |
166 | 176 |
167 if (enable_nacl) { | 177 if (enable_nacl) { |
168 if (is_nacl) { | 178 if (is_nacl) { |
169 executable("ppapi_nacl_tests_newlib") { | 179 shared_library("ppapi_cpp_lib_shared") { |
170 include_dirs = [ | 180 deps = [ |
171 "lib/gl/include", | 181 ":ppapi_cpp_lib", |
172 "..", | |
173 ] | 182 ] |
183 } | |
184 | |
185 executable("ppapi_nacl_tests") { | |
186 output_name = "ppapi_nacl_tests" | |
187 | |
188 if (is_nacl_glibc) { | |
189 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |
Roland McGrath
2015/09/14 20:19:51
Why is this here? It needs a comment.
Petr Hosek
2015/09/14 23:50:44
Done.
| |
190 } | |
191 | |
192 include_dirs = [ "lib/gl/include" ] | |
174 | 193 |
175 sources = ppapi_sources.test_common_source_files + | 194 sources = ppapi_sources.test_common_source_files + |
176 ppapi_sources.test_nacl_source_files | 195 ppapi_sources.test_nacl_source_files |
177 | 196 |
178 defines = [ "GL_GLEXT_PROTOTYPES" ] | 197 defines = [ "GL_GLEXT_PROTOTYPES" ] |
179 | 198 |
199 if (is_nacl_glibc) { | |
200 ldflags = [ "-pthread" ] | |
Roland McGrath
2015/09/14 20:19:51
Don't all the NaCl toolchains accept -pthread?
Petr Hosek
2015/09/14 23:50:44
True, it doesn't hurt to have it here unconditiona
| |
201 } | |
202 | |
180 deps = [ | 203 deps = [ |
181 ":ppapi_cpp_lib", | 204 "//build/config/nacl:nacl_base", |
182 "//ppapi/native_client:ppapi_lib", | 205 "//ppapi/native_client:ppapi_lib", |
183 ] | 206 ] |
207 if (is_nacl_glibc) { | |
208 deps += [ ":ppapi_cpp_lib_shared" ] | |
209 } else { | |
210 deps += [ ":ppapi_cpp_lib" ] | |
211 } | |
184 } | 212 } |
185 | 213 |
186 copy("nacl_tests_copy") { | 214 copy("nacl_tests_copy") { |
187 sources = [ | 215 sources = [ |
188 "${root_out_dir}/ppapi_nacl_tests_newlib.nexe", | 216 "${root_out_dir}/ppapi_nacl_tests.nexe", |
189 ] | 217 ] |
218 if (is_nacl_glibc) { | |
219 suffix = "glibc" | |
220 } else { | |
221 suffix = "newlib" | |
222 } | |
190 outputs = [ | 223 outputs = [ |
191 "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe", | 224 "${root_build_dir}/{{source_name_part}}_${target_cpu}_${suffix}.nexe", |
192 ] | 225 ] |
193 deps = [ | 226 deps = [ |
194 ":ppapi_nacl_tests_newlib", | 227 ":ppapi_nacl_tests", |
228 ] | |
229 } | |
230 | |
231 action("generate_nmf") { | |
232 nacl_toolchain_dir = rebase_path("//native_client/toolchain") | |
233 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" | |
234 if (is_nacl_glibc) { | |
235 toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" | |
236 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" | |
237 } else { | |
238 toolchain_dir = "${os_toolchain_dir}/nacl_x86_newlib" | |
239 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" | |
240 } | |
241 script = "//native_client_sdk/src/tools/create_nmf.py" | |
242 sources = get_target_outputs(":nacl_tests_copy") | |
243 outputs = [ | |
244 nmf, | |
245 ] | |
246 nmf_flags = [] | |
247 if (is_nacl_glibc) { | |
248 nmf_flags += [ "--library-path=" + rebase_path(root_out_dir) ] | |
249 if (current_cpu == "x86") { | |
250 nmf_flags += [ "--library-path=" + | |
251 rebase_path("${toolchain_dir}/x86_64-nacl/lib32", | |
252 root_build_dir) ] | |
253 } | |
254 if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) { | |
255 nmf_flags += [ "--library-path=" + | |
256 rebase_path("${toolchain_dir}/x86_64-nacl/lib", | |
257 root_build_dir) ] | |
258 } | |
259 } | |
260 args = [ | |
261 "--no-default-libpath", | |
262 "--objdump=${toolchain_dir}/bin/x86_64-nacl-objdump", | |
263 "--output=" + rebase_path(nmf, root_build_dir), | |
264 "--stage-dependencies=" + rebase_path(root_build_dir), | |
265 ] + nmf_flags + rebase_path(sources, root_build_dir) | |
266 deps = [ | |
267 ":nacl_tests_copy", | |
195 ] | 268 ] |
196 } | 269 } |
197 } | 270 } |
198 | 271 |
199 group("ppapi_nacl_tests") { | 272 group("ppapi_nacl_tests_all") { |
200 deps = [] | 273 deps = [] |
201 if (target_cpu == "x86" || target_cpu == "x64") { | 274 if (target_cpu == "x86" || target_cpu == "x64") { |
202 deps += [ ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_c pu})" ] | 275 deps += [ |
276 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", | |
277 ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", | |
278 ] | |
203 } | 279 } |
204 } | 280 } |
205 } | 281 } |
OLD | NEW |