diff options
author | phosek <phosek@chromium.org> | 2016-01-12 00:53:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-12 08:54:49 +0000 |
commit | a0f606b1a300011c7be6270268874efe5b7b0a38 (patch) | |
tree | edbba27c736d95733a6d315cd173b180f5dd8b20 | |
parent | 65098f08be3de0427df1a33cc7eb2f87469ec780 (diff) | |
download | chromium_src-a0f606b1a300011c7be6270268874efe5b7b0a38.zip chromium_src-a0f606b1a300011c7be6270268874efe5b7b0a38.tar.gz chromium_src-a0f606b1a300011c7be6270268874efe5b7b0a38.tar.bz2 |
Reland of GN: Properly mark all NaCl test depencies as data_deps
NaCl tests and helpers are build as standalone executables and
hence need to be marked as data_deps to be copied over to shards.
BUG=462791
CQ_EXTRA_TRYBOTS=tryserver.chromium.win:win8_chromium_gn_dbg,win_chromium_gn_x64_rel
Review URL: https://codereview.chromium.org/1563093003
Cr-Commit-Position: refs/heads/master@{#368833}
-rw-r--r-- | chrome/test/BUILD.gn | 2 | ||||
-rw-r--r-- | chrome/test/data/nacl/BUILD.gn | 6 | ||||
-rw-r--r-- | components/nacl/loader/BUILD.gn | 3 | ||||
-rw-r--r-- | extensions/shell/BUILD.gn | 5 | ||||
-rw-r--r-- | ppapi/BUILD.gn | 86 | ||||
-rw-r--r-- | ppapi/native_client/BUILD.gn | 12 | ||||
-rw-r--r-- | ppapi/tests/extensions/BUILD.gn | 4 |
7 files changed, 73 insertions, 45 deletions
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 34f2223..2dcbb28 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -981,7 +981,7 @@ if (!is_android) { } if (is_win || is_linux) { sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ] - deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ] + data_deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ] } if (is_win) { # TODO(halyavin) NaCl on Windows can't open debug stub socket in diff --git a/chrome/test/data/nacl/BUILD.gn b/chrome/test/data/nacl/BUILD.gn index a47619d..beb8da5 100644 --- a/chrome/test/data/nacl/BUILD.gn +++ b/chrome/test/data/nacl/BUILD.gn @@ -9,7 +9,7 @@ group("nacl") { newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}" glibc = "//build/toolchain/nacl:glibc_${target_cpu}" pnacl = "//build/toolchain/nacl:newlib_pnacl" - deps = [ + data_deps = [ ":exit_status_test($glibc)", ":exit_status_test($newlib)", ":exit_status_test($pnacl)", @@ -74,13 +74,13 @@ group("nacl") { ] if (is_linux) { nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi" - deps += [ + data_deps += [ ":irt_exception_test($nonsfi)", ":irt_manifest_file($nonsfi)", ":shared_test_files($nonsfi)", ] if (is_clang) { - deps += [ ":nonsfi_libc_free" ] + data_deps += [ ":nonsfi_libc_free" ] } } } diff --git a/components/nacl/loader/BUILD.gn b/components/nacl/loader/BUILD.gn index e9d9d9c..7e1dac8 100644 --- a/components/nacl/loader/BUILD.gn +++ b/components/nacl/loader/BUILD.gn @@ -164,7 +164,7 @@ if (is_linux) { } group("helper_nonsfi") { - deps = [ + data_deps = [ ":nacl_helper_nonsfi_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)", ] } @@ -183,6 +183,7 @@ if (is_linux) { testonly = true data_deps = [ ":helper_nonsfi_unittests", + ":nacl_helper_nonsfi_unittests_main_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)", ] } } diff --git a/extensions/shell/BUILD.gn b/extensions/shell/BUILD.gn index 0f8af6e..8cb0dd3 100644 --- a/extensions/shell/BUILD.gn +++ b/extensions/shell/BUILD.gn @@ -104,7 +104,10 @@ source_set("app_shell_lib") { ] if (is_linux) { - deps += [ "//components/nacl/loader:nacl_helper" ] + deps += [ + "//components/nacl/loader:helper_nonsfi", + "//components/nacl/loader:nacl_helper", + ] } } diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn index 842dbbd..182287f 100644 --- a/ppapi/BUILD.gn +++ b/ppapi/BUILD.gn @@ -193,6 +193,8 @@ source_set("ppapi_gles2_lib") { if (enable_nacl) { if (is_nacl) { shared_library("ppapi_cpp_lib_shared") { + output_name = "libppapi_cpp" + # When using gcc, we hide all symbols by default, but that breaks at # link time as the test executable requires symbols defined in the # shared library. @@ -211,7 +213,8 @@ if (enable_nacl) { ] } - executable("ppapi_nacl_tests") { + executable("ppapi_nacl_tests_nexe") { + output_name = "ppapi_nacl_tests" include_dirs = [ "lib/gl/include" ] sources = ppapi_sources.test_common_source_files + ppapi_sources.test_nacl_source_files @@ -235,7 +238,7 @@ if (enable_nacl) { action("translate_pexe_to_nexe") { # We specify the toolchain explicitly because in the Non-SFI case, we # still want to use the pexe built using the newlib_pnacl toolchain. - tests = ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)" + tests = ":ppapi_nacl_tests_nexe(//build/toolchain/nacl:newlib_pnacl)" pexe = get_label_info(tests, "root_out_dir") + "/ppapi_nacl_tests.pexe" nexe = "${root_out_dir}/ppapi_nacl_tests.nexe" @@ -295,26 +298,29 @@ if (enable_nacl) { } } - copy("nacl_tests_copy") { + copy("ppapi_nacl_tests_copy") { sources = [ "${root_out_dir}/ppapi_nacl_tests.nexe", ] # The CPU names used in tests/ppapi_nacl_tests_newlib.nmf # are the ones used in GYP (x32 for x86). - if (current_cpu == "pnacl") { - suffix = "pnacl" + if (target_cpu == "x86" || + (is_nacl_nonsfi && (target_cpu == "x86" || target_cpu == "x64"))) { + nmf_cpu = "x32" } else { - if (target_cpu == "x86") { - nmf_cpu = "x32" - } else { - nmf_cpu = target_cpu - } - if (is_nacl_glibc) { - suffix = "glibc_${nmf_cpu}" + nmf_cpu = target_cpu + } + if (current_cpu == "pnacl") { + if (is_nacl_nonsfi) { + suffix = "pnacl_newlib_${nmf_cpu}_nonsfi" } else { - suffix = "newlib_${nmf_cpu}" + suffix = "pnacl_newlib_${nmf_cpu}" } + } else if (is_nacl_glibc) { + suffix = "glibc_${nmf_cpu}" + } else { + suffix = "newlib_${nmf_cpu}" } outputs = [ "${root_build_dir}/{{source_name_part}}_${suffix}.nexe", @@ -325,31 +331,41 @@ if (enable_nacl) { ] } else { deps = [ - ":ppapi_nacl_tests", + ":ppapi_nacl_tests_nexe", ] } } - generate_nmf("ppapi_nacl_tests_nmf") { - if (is_nacl_glibc) { - nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" - stage_dependencies = root_build_dir - } else if (current_cpu == "pnacl") { - nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" - } else { - nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" + if (is_nacl_nonsfi) { + generate_nonsfi_test_nmf("ppapi_nacl_tests_nmf") { + nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf" + files = get_target_outputs(":ppapi_nacl_tests_copy") + executable = files[0] + deps = [ + ":ppapi_nacl_tests_copy", + ] + } + } else { + generate_nmf("ppapi_nacl_tests_nmf") { + if (is_nacl_glibc) { + nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" + stage_dependencies = root_build_dir + } else if (current_cpu == "pnacl") { + nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf" + } else { + nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" + } + executables = get_target_outputs(":ppapi_nacl_tests_copy") + deps = [ + ":ppapi_nacl_tests_copy", + ] } - executables = get_target_outputs(":nacl_tests_copy") - deps = [ - ":nacl_tests_copy", - ] } - generate_nonsfi_test_nmf("ppapi_nacl_tests_pnacl_nonsfi_nmf") { - nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf" - executable = "${root_out_dir}/ppapi_nacl_tests.nexe" - deps = [ - ":translate_pexe_to_nexe", + group("ppapi_nacl_tests") { + data_deps = [ + ":ppapi_nacl_tests_copy", + ":ppapi_nacl_tests_nmf", ] } } @@ -357,13 +373,13 @@ if (enable_nacl) { group("ppapi_nacl_tests_all") { data_deps = [ ":copy_test_files", - ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", - ":ppapi_nacl_tests_nmf(//build/toolchain/nacl:glibc_${target_cpu})", + ":ppapi_nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", + ":ppapi_nacl_tests(//build/toolchain/nacl:glibc_${target_cpu})", ] if (enable_pnacl) { data_deps += [ - ":ppapi_nacl_tests_nmf(//build/toolchain/nacl:newlib_pnacl)", - ":ppapi_nacl_tests_pnacl_nonsfi_nmf(//build/toolchain/nacl:newlib_pnacl_nonsfi)", + ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)", + ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl_nonsfi)", ] } } diff --git a/ppapi/native_client/BUILD.gn b/ppapi/native_client/BUILD.gn index fea6236..5c49d1e 100644 --- a/ppapi/native_client/BUILD.gn +++ b/ppapi/native_client/BUILD.gn @@ -95,16 +95,24 @@ if (is_nacl) { } group("irt") { - public_deps = [ + # The nacl_irt needs to be marked as data dependency so that it's + # properly resolved as runtime dependency. However, some target + # use nacl_irt as input for actions which require it to be marked + # as public dependency as well. + irt_deps = [ ":nacl_irt_debug(//build/toolchain/nacl:irt_${target_cpu})", ":nacl_irt_debuglink(//build/toolchain/nacl:irt_${target_cpu})", ] + public_deps = irt_deps + data_deps = irt_deps # On 32-bit Windows, we also ship the 64-bit IRT. if (is_win && target_cpu == "x86") { - public_deps += [ + irt_x64_deps = [ ":nacl_irt_debug(//build/toolchain/nacl:irt_x64)", ":nacl_irt_debuglink(//build/toolchain/nacl:irt_x64)", ] + public_deps += irt_x64_deps + data_deps += irt_x64_deps } } diff --git a/ppapi/tests/extensions/BUILD.gn b/ppapi/tests/extensions/BUILD.gn index 741ba71..615a103 100644 --- a/ppapi/tests/extensions/BUILD.gn +++ b/ppapi/tests/extensions/BUILD.gn @@ -8,7 +8,7 @@ import("//ppapi/native_client/nacl_test_data.gni") group("extensions") { newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}" pnacl = "//build/toolchain/nacl:newlib_pnacl" - deps = [ + data_deps = [ ":ppapi_tests_extensions_background_keepalive($newlib)", ":ppapi_tests_extensions_load_unload($newlib)", ":ppapi_tests_extensions_media_galleries($newlib)", @@ -21,7 +21,7 @@ group("extensions") { ] if ((target_cpu == "x86" || target_cpu == "x64") && is_linux) { nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi" - deps += [ ":ppapi_tests_extensions_packaged_app($nonsfi)" ] + data_deps += [ ":ppapi_tests_extensions_packaged_app($nonsfi)" ] } } |