Chromium Code Reviews| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 "//build/config/nacl:nacl_base", | 202 "//build/config/nacl:nacl_base", |
| 203 "//ppapi/native_client:ppapi_lib", | 203 "//ppapi/native_client:ppapi_lib", |
| 204 ] | 204 ] |
| 205 if (is_nacl_glibc) { | 205 if (is_nacl_glibc) { |
| 206 deps += [ ":ppapi_cpp_lib_shared" ] | 206 deps += [ ":ppapi_cpp_lib_shared" ] |
| 207 } else { | 207 } else { |
| 208 deps += [ ":ppapi_cpp_lib" ] | 208 deps += [ ":ppapi_cpp_lib" ] |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 if (current_cpu == "pnacl") { | |
| 213 action("translate_pexe_to_nexe") { | |
| 214 nacl_toolchain_dir = rebase_path("//native_client/toolchain") | |
|
Roland McGrath
2015/09/30 20:26:33
Hoist these *_dir variables up into the if (is_nac
Petr Hosek
2015/09/30 23:22:03
Done, I've moved `nacl_toolchain_dir` and `os_tool
| |
| 215 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" | |
| 216 script = "${os_toolchain_dir}/pnacl_newlib/bin/pydir/loader.py" | |
|
Roland McGrath
2015/09/30 20:26:33
Can you put script next to sources and outputs and
Petr Hosek
2015/09/30 23:22:03
Done.
| |
| 217 pexe = "${root_out_dir}/ppapi_nacl_tests.pexe" | |
| 218 nexe = "${root_out_dir}/ppapi_nacl_tests.nexe" | |
| 219 sources = [ | |
| 220 pexe, | |
| 221 ] | |
| 222 outputs = [ | |
| 223 nexe, | |
| 224 ] | |
| 225 | |
| 226 # TODO(phosek): remove the following once change 1360243003 is rolled | |
| 227 # into Chrome and use $target_cpu directly. | |
| 228 if (target_cpu == "x86") { | |
| 229 arch = "i686" | |
| 230 } else if (target_cpu == "x64") { | |
| 231 arch = "x86-64" | |
| 232 } else if (target_cpu == "arm") { | |
| 233 arch = "armv7" | |
| 234 } | |
| 235 args = [ | |
| 236 "pnacl-translate", | |
|
Roland McGrath
2015/09/30 20:26:33
Please have dschuff review the details of calling
Petr Hosek
2015/09/30 23:22:03
Done, Derek already helped me debugging this.
| |
| 237 rebase_path(pexe), | |
| 238 "-o", | |
| 239 rebase_path(nexe), | |
| 240 "-arch", | |
| 241 arch, | |
| 242 "-Wl,-L" + rebase_path( | |
| 243 get_label_info( | |
| 244 "//ppapi/native_client/src/untrusted/pnacl_irt_shim:aot(// build/toolchain/nacl:clang_newlib_${target_cpu})", | |
|
Roland McGrath
2015/09/30 20:26:33
Put this long label into a variable and use the va
Petr Hosek
2015/09/30 23:22:03
Done.
| |
| 245 "target_out_dir")), | |
| 246 ] | |
| 247 deps = [ | |
| 248 ":ppapi_nacl_tests", | |
| 249 ] | |
| 250 data_deps = [ | |
| 251 "//ppapi/native_client/src/untrusted/pnacl_irt_shim:aot(//build/toolch ain/nacl:clang_newlib_${target_cpu})", | |
| 252 ] | |
| 253 } | |
| 254 } | |
| 255 | |
| 212 copy("nacl_tests_copy") { | 256 copy("nacl_tests_copy") { |
| 213 sources = [ | 257 sources = [ |
| 214 "${root_out_dir}/ppapi_nacl_tests.nexe", | 258 "${root_out_dir}/ppapi_nacl_tests.nexe", |
| 215 ] | 259 ] |
| 216 if (is_nacl_glibc) { | 260 if (is_nacl_glibc) { |
| 217 suffix = "glibc" | 261 suffix = "glibc_${target_cpu}" |
|
Roland McGrath
2015/09/30 20:26:33
This needs to be merged with the nmf_cpu logic bel
Petr Hosek
2015/09/30 23:22:03
Done.
| |
| 262 } else if (current_cpu == "pnacl") { | |
| 263 suffix = "pnacl" | |
| 218 } else { | 264 } else { |
| 219 suffix = "newlib" | 265 suffix = "newlib_${target_cpu}" |
| 220 } | 266 } |
| 221 | 267 |
| 222 # The CPU names used in tests/ppapi_nacl_tests_newlib.nmf | 268 # The CPU names used in tests/ppapi_nacl_tests_newlib.nmf |
| 223 # are the ones used in GYP (x32 for x86). | 269 # are the ones used in GYP (x32 for x86). |
| 224 if (target_cpu == "x86") { | 270 if (target_cpu == "x86") { |
| 225 nmf_cpu = "x32" | 271 nmf_cpu = "x32" |
| 226 } else { | 272 } else { |
| 227 nmf_cpu = target_cpu | 273 nmf_cpu = target_cpu |
| 228 } | 274 } |
| 229 outputs = [ | 275 outputs = [ |
| 230 "${root_build_dir}/{{source_name_part}}_${suffix}_${nmf_cpu}.nexe", | 276 "${root_build_dir}/{{source_name_part}}_${suffix}_${nmf_cpu}.nexe", |
| 231 ] | 277 ] |
| 232 deps = [ | 278 if (current_cpu == "pnacl") { |
| 233 ":ppapi_nacl_tests", | 279 deps = [ |
| 234 ] | 280 ":translate_pexe_to_nexe", |
| 281 ] | |
| 282 } else { | |
| 283 deps = [ | |
| 284 ":ppapi_nacl_tests", | |
| 285 ] | |
| 286 } | |
| 235 } | 287 } |
| 236 | 288 |
| 237 action("generate_nmf") { | 289 action("generate_nmf") { |
| 238 nacl_toolchain_dir = rebase_path("//native_client/toolchain") | 290 nacl_toolchain_dir = rebase_path("//native_client/toolchain") |
| 239 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" | 291 os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" |
| 240 if (is_nacl_glibc) { | 292 if (is_nacl_glibc) { |
| 241 toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" | 293 toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" |
| 242 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" | 294 nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" |
| 295 } else if (current_cpu == "pnacl") { | |
| 296 toolchain_dir = "${os_toolchain_dir}/pnacl_newlib" | |
|
Roland McGrath
2015/09/30 20:26:33
The toolchain definitions already have toolchain_p
Petr Hosek
2015/09/30 23:22:03
I'm thinking about turning `toolchain_package` and
| |
| 297 nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" | |
| 243 } else { | 298 } else { |
| 244 toolchain_dir = "${os_toolchain_dir}/nacl_x86_newlib" | 299 toolchain_dir = "${os_toolchain_dir}/nacl_x86_newlib" |
| 245 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" | 300 nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" |
| 246 } | 301 } |
| 247 script = "//native_client_sdk/src/tools/create_nmf.py" | 302 script = "//native_client_sdk/src/tools/create_nmf.py" |
| 248 sources = get_target_outputs(":nacl_tests_copy") | 303 sources = get_target_outputs(":nacl_tests_copy") |
| 249 outputs = [ | 304 outputs = [ |
| 250 nmf, | 305 nmf, |
| 251 ] | 306 ] |
| 252 nmf_flags = [] | 307 nmf_flags = [] |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 } | 339 } |
| 285 } | 340 } |
| 286 | 341 |
| 287 group("ppapi_nacl_tests_all") { | 342 group("ppapi_nacl_tests_all") { |
| 288 data_deps = [] | 343 data_deps = [] |
| 289 if (target_cpu == "x86" || target_cpu == "x64") { | 344 if (target_cpu == "x86" || target_cpu == "x64") { |
| 290 data_deps += [ | 345 data_deps += [ |
| 291 ":copy_test_files", | 346 ":copy_test_files", |
| 292 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", | 347 ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", |
| 293 ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", | 348 ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", |
| 349 ":generate_nmf(//build/toolchain/nacl:newlib_pnacl)", | |
|
Roland McGrath
2015/09/30 20:26:33
What is the purpose of doing generate_nmf for newl
Petr Hosek
2015/09/30 23:22:03
The goal is to match the GYP behavior and possibly
| |
| 294 ] | 350 ] |
| 295 } | 351 } |
| 296 } | 352 } |
| 297 } | 353 } |
| OLD | NEW |