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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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") { |
148 sources = ppapi_sources.cpp_source_files | 149 sources = ppapi_sources.cpp_source_files |
149 sources += [ | 150 sources += [ |
150 "cpp/module_embedder.h", | 151 "cpp/module_embedder.h", |
151 "cpp/ppp_entrypoints.cc", | 152 "cpp/ppp_entrypoints.cc", |
152 ] | 153 ] |
154 deps = [ | |
155 "//build/config/nacl:nacl_base", | |
156 ] | |
153 } | 157 } |
154 | 158 |
155 source_set("ppapi_gles2_lib") { | 159 source_set("ppapi_gles2_lib") { |
156 include_dirs = [ "lib/gl/include" ] | 160 include_dirs = [ "lib/gl/include" ] |
157 sources = [ | 161 sources = [ |
158 "lib/gl/gles2/gl2ext_ppapi.c", | 162 "lib/gl/gles2/gl2ext_ppapi.c", |
159 "lib/gl/gles2/gl2ext_ppapi.h", | 163 "lib/gl/gles2/gl2ext_ppapi.h", |
160 "lib/gl/gles2/gles2.c", | 164 "lib/gl/gles2/gles2.c", |
161 ] | 165 ] |
162 deps = [ | 166 deps = [ |
163 "//ppapi/cpp", | 167 "//ppapi/cpp", |
164 ] | 168 ] |
165 } | 169 } |
166 | 170 |
167 if (enable_nacl) { | 171 if (enable_nacl) { |
168 if (is_nacl) { | 172 if (is_nacl) { |
169 executable("ppapi_nacl_tests_newlib") { | 173 shared_library("ppapi_cpp_lib_shared") { |
170 include_dirs = [ | 174 # When using gcc, we hide all symbols by default, but that breaks at |
171 "lib/gl/include", | 175 # link time as the test executable requires symbols defined in the |
172 "..", | 176 # shared library. |
177 if (is_nacl_glibc) { | |
178 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |
179 } | |
180 | |
181 sources = ppapi_sources.cpp_source_files | |
182 sources += [ | |
183 "cpp/module_embedder.h", | |
184 "cpp/ppp_entrypoints.cc", | |
173 ] | 185 ] |
186 cflags = [ "-fPIC" ] | |
187 deps = [ | |
188 "//build/config/nacl:nacl_base", | |
189 ] | |
190 } | |
174 | 191 |
192 executable("ppapi_nacl_tests") { | |
193 # When using gcc, we hide all symbols by default, but that breaks at | |
194 # link time as the shared library references pp::CreateModule method | |
195 # defined by the test executable. | |
Roland McGrath
2015/09/17 18:16:52
Fine enough I guess, though it seems like it might
Petr Hosek
2015/09/17 21:54:08
Done.
| |
196 if (is_nacl_glibc) { | |
197 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |
198 } | |
199 | |
200 include_dirs = [ "lib/gl/include" ] | |
175 sources = ppapi_sources.test_common_source_files + | 201 sources = ppapi_sources.test_common_source_files + |
176 ppapi_sources.test_nacl_source_files | 202 ppapi_sources.test_nacl_source_files |
177 | |
178 defines = [ "GL_GLEXT_PROTOTYPES" ] | 203 defines = [ "GL_GLEXT_PROTOTYPES" ] |
179 | 204 ldflags = [ "-pthread" ] |
180 deps = [ | 205 deps = [ |
181 ":ppapi_cpp_lib", | 206 "//build/config/nacl:nacl_base", |
182 "//ppapi/native_client:ppapi_lib", | 207 "//ppapi/native_client:ppapi_lib", |
183 ] | 208 ] |
209 if (is_nacl_glibc) { | |
210 deps += [ ":ppapi_cpp_lib_shared" ] | |
211 } else { | |
212 deps += [ ":ppapi_cpp_lib" ] | |
213 } | |
184 } | 214 } |
185 | 215 |
186 copy("nacl_tests_copy") { | 216 copy("nacl_tests_copy") { |
187 sources = [ | 217 sources = [ |
188 "${root_out_dir}/ppapi_nacl_tests_newlib.nexe", | 218 "${root_out_dir}/ppapi_nacl_tests.nexe", |
189 ] | 219 ] |
220 if (is_nacl_glibc) { | |
221 suffix = "glibc" | |
222 } else { | |
223 suffix = "newlib" | |
224 } | |
190 outputs = [ | 225 outputs = [ |
191 "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe", | 226 "${root_build_dir}/{{source_name_part}}_${target_cpu}_${suffix}.nexe", |
192 ] | 227 ] |
193 deps = [ | 228 deps = [ |
194 ":ppapi_nacl_tests_newlib", | 229 ":ppapi_nacl_tests", |
230 ] | |
231 } | |
232 | |
233 action("generate_nmf") { | |
234 nacl_toolchain_dir = rebase_path("//native_client/toolchain") | |
235 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" | |
236 if (is_nacl_glibc) { | |
237 toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" | |
238 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" | |
239 } else { | |
240 toolchain_dir = "${os_toolchain_dir}/nacl_x86_newlib" | |
241 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" | |
242 } | |
243 script = "//native_client_sdk/src/tools/create_nmf.py" | |
244 sources = get_target_outputs(":nacl_tests_copy") | |
245 outputs = [ | |
246 nmf, | |
247 ] | |
248 nmf_flags = [] | |
249 if (is_nacl_glibc) { | |
250 nmf_flags += [ "--library-path=" + rebase_path(root_out_dir) ] | |
251 if (current_cpu == "x86") { | |
252 nmf_flags += [ "--library-path=" + | |
253 rebase_path("${toolchain_dir}/x86_64-nacl/lib32", | |
254 root_build_dir) ] | |
255 } | |
256 if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) { | |
257 nmf_flags += [ "--library-path=" + | |
258 rebase_path("${toolchain_dir}/x86_64-nacl/lib", | |
259 root_build_dir) ] | |
260 } | |
261 } | |
262 args = [ | |
263 "--no-default-libpath", | |
264 "--objdump=${toolchain_dir}/bin/x86_64-nacl-objdump", | |
265 "--output=" + rebase_path(nmf, root_build_dir), | |
266 "--stage-dependencies=" + rebase_path(root_build_dir), | |
267 ] + nmf_flags + rebase_path(sources, root_build_dir) | |
268 deps = [ | |
269 ":nacl_tests_copy", | |
195 ] | 270 ] |
196 } | 271 } |
197 } | 272 } |
198 | 273 |
199 group("ppapi_nacl_tests") { | 274 group("ppapi_nacl_tests_all") { |
200 deps = [] | 275 deps = [] |
201 if (target_cpu == "x86" || target_cpu == "x64") { | 276 if (target_cpu == "x86" || target_cpu == "x64") { |
202 deps += [ ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_c pu})" ] | 277 deps += [ |
278 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", | |
279 ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", | |
280 ] | |
203 } | 281 } |
204 } | 282 } |
205 } | 283 } |
OLD | NEW |