| 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 include_dirs = [ "lib/gl/include" ] |
| 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 defines = [ |
| 178 defines = [ "GL_GLEXT_PROTOTYPES" ] | 197 "GL_GLEXT_PROTOTYPES", |
| 179 | 198 "PPAPI_TEST_IMPLEMENTATION", |
| 199 ] |
| 200 ldflags = [ "-pthread" ] |
| 180 deps = [ | 201 deps = [ |
| 181 ":ppapi_cpp_lib", | 202 "//build/config/nacl:nacl_base", |
| 182 "//ppapi/native_client:ppapi_lib", | 203 "//ppapi/native_client:ppapi_lib", |
| 183 ] | 204 ] |
| 205 if (is_nacl_glibc) { |
| 206 deps += [ ":ppapi_cpp_lib_shared" ] |
| 207 } else { |
| 208 deps += [ ":ppapi_cpp_lib" ] |
| 209 } |
| 184 } | 210 } |
| 185 | 211 |
| 186 copy("nacl_tests_copy") { | 212 copy("nacl_tests_copy") { |
| 187 sources = [ | 213 sources = [ |
| 188 "${root_out_dir}/ppapi_nacl_tests_newlib.nexe", | 214 "${root_out_dir}/ppapi_nacl_tests.nexe", |
| 189 ] | 215 ] |
| 216 if (is_nacl_glibc) { |
| 217 suffix = "glibc" |
| 218 } else { |
| 219 suffix = "newlib" |
| 220 } |
| 190 outputs = [ | 221 outputs = [ |
| 191 "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe", | 222 "${root_build_dir}/{{source_name_part}}_${suffix}_${target_cpu}.nexe", |
| 192 ] | 223 ] |
| 193 deps = [ | 224 deps = [ |
| 194 ":ppapi_nacl_tests_newlib", | 225 ":ppapi_nacl_tests", |
| 226 ] |
| 227 } |
| 228 |
| 229 action("generate_nmf") { |
| 230 nacl_toolchain_dir = rebase_path("//native_client/toolchain") |
| 231 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" |
| 232 if (is_nacl_glibc) { |
| 233 toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" |
| 234 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" |
| 235 } else { |
| 236 toolchain_dir = "${os_toolchain_dir}/nacl_x86_newlib" |
| 237 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" |
| 238 } |
| 239 script = "//native_client_sdk/src/tools/create_nmf.py" |
| 240 sources = get_target_outputs(":nacl_tests_copy") |
| 241 outputs = [ |
| 242 nmf, |
| 243 ] |
| 244 nmf_flags = [] |
| 245 if (is_nacl_glibc) { |
| 246 nmf_flags += [ "--library-path=" + rebase_path(root_out_dir) ] |
| 247 if (current_cpu == "x86") { |
| 248 nmf_flags += [ "--library-path=" + |
| 249 rebase_path("${toolchain_dir}/x86_64-nacl/lib32", |
| 250 root_build_dir) ] |
| 251 data = [ |
| 252 "$root_build_dir/lib32/", |
| 253 ] |
| 254 } |
| 255 if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) { |
| 256 nmf_flags += [ "--library-path=" + |
| 257 rebase_path("${toolchain_dir}/x86_64-nacl/lib", |
| 258 root_build_dir) ] |
| 259 data = [ |
| 260 "$root_build_dir/lib64/", |
| 261 ] |
| 262 } |
| 263 } |
| 264 args = [ |
| 265 "--no-default-libpath", |
| 266 "--objdump=${toolchain_dir}/bin/x86_64-nacl-objdump", |
| 267 "--output=" + rebase_path(nmf, root_build_dir), |
| 268 "--stage-dependencies=" + rebase_path(root_build_dir), |
| 269 ] + nmf_flags + rebase_path(sources, root_build_dir) |
| 270 deps = [ |
| 271 ":nacl_tests_copy", |
| 272 ] |
| 273 data_deps = [ ":nacl_tests_copy" ] |
| 274 } |
| 275 } |
| 276 |
| 277 group("ppapi_nacl_tests_all") { |
| 278 data_deps = [] |
| 279 if (target_cpu == "x86" || target_cpu == "x64") { |
| 280 data_deps += [ |
| 281 ":copy_test_files", |
| 282 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", |
| 283 ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", |
| 195 ] | 284 ] |
| 196 } | 285 } |
| 197 } | 286 } |
| 198 | |
| 199 group("ppapi_nacl_tests") { | |
| 200 deps = [ | |
| 201 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", | |
| 202 ] | |
| 203 } | |
| 204 } | 287 } |
| OLD | NEW |