Chromium Code Reviews| Index: ppapi/BUILD.gn |
| diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn |
| index 22498434f42217d2aecd25b867fab07a5beab19f..05dac78937a105b1252fa2b4aeaa86d85c7b7398 100644 |
| --- a/ppapi/BUILD.gn |
| +++ b/ppapi/BUILD.gn |
| @@ -28,6 +28,7 @@ copy("copy_test_files2") { |
| } |
| import("//build/config/features.gni") |
| +import("//build/config/nacl/config.gni") |
| import("//ppapi/ppapi_sources.gni") |
| import("//testing/test.gni") |
| @@ -145,11 +146,20 @@ executable("pepper_hash_for_uma") { |
| } |
| source_set("ppapi_cpp_lib") { |
| + if (is_posix) { |
| + 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.
|
| + } |
| sources = ppapi_sources.cpp_source_files |
| sources += [ |
| "cpp/module_embedder.h", |
| "cpp/ppp_entrypoints.cc", |
| ] |
| + if (is_nacl) { |
| + 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
|
| + } |
| + deps = [ |
| + "//build/config/nacl:nacl_base", |
| + ] |
| } |
| source_set("ppapi_gles2_lib") { |
| @@ -166,40 +176,106 @@ source_set("ppapi_gles2_lib") { |
| if (enable_nacl) { |
| if (is_nacl) { |
| - executable("ppapi_nacl_tests_newlib") { |
| - include_dirs = [ |
| - "lib/gl/include", |
| - "..", |
| + shared_library("ppapi_cpp_lib_shared") { |
| + deps = [ |
| + ":ppapi_cpp_lib", |
| ] |
| + } |
| + |
| + executable("ppapi_nacl_tests") { |
| + output_name = "ppapi_nacl_tests" |
| + |
| + if (is_nacl_glibc) { |
| + 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.
|
| + } |
| + |
| + include_dirs = [ "lib/gl/include" ] |
| sources = ppapi_sources.test_common_source_files + |
| ppapi_sources.test_nacl_source_files |
| defines = [ "GL_GLEXT_PROTOTYPES" ] |
| + if (is_nacl_glibc) { |
| + 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
|
| + } |
| + |
| deps = [ |
| - ":ppapi_cpp_lib", |
| + "//build/config/nacl:nacl_base", |
| "//ppapi/native_client:ppapi_lib", |
| ] |
| + if (is_nacl_glibc) { |
| + deps += [ ":ppapi_cpp_lib_shared" ] |
| + } else { |
| + deps += [ ":ppapi_cpp_lib" ] |
| + } |
| } |
| copy("nacl_tests_copy") { |
| sources = [ |
| - "${root_out_dir}/ppapi_nacl_tests_newlib.nexe", |
| + "${root_out_dir}/ppapi_nacl_tests.nexe", |
| + ] |
| + if (is_nacl_glibc) { |
| + suffix = "glibc" |
| + } else { |
| + suffix = "newlib" |
| + } |
| + outputs = [ |
| + "${root_build_dir}/{{source_name_part}}_${target_cpu}_${suffix}.nexe", |
| ] |
| + deps = [ |
| + ":ppapi_nacl_tests", |
| + ] |
| + } |
| + |
| + action("generate_nmf") { |
| + nacl_toolchain_dir = rebase_path("//native_client/toolchain") |
| + os_toolchain_dir = "${nacl_toolchain_dir}/${host_os}_x86" |
| + if (is_nacl_glibc) { |
| + toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" |
| + nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" |
| + } else { |
| + toolchain_dir = "${os_toolchain_dir}/nacl_x86_newlib" |
| + nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf" |
| + } |
| + script = "//native_client_sdk/src/tools/create_nmf.py" |
| + sources = get_target_outputs(":nacl_tests_copy") |
| outputs = [ |
| - "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe", |
| + nmf, |
| ] |
| + nmf_flags = [] |
| + if (is_nacl_glibc) { |
| + nmf_flags += [ "--library-path=" + rebase_path(root_out_dir) ] |
| + if (current_cpu == "x86") { |
| + nmf_flags += [ "--library-path=" + |
| + rebase_path("${toolchain_dir}/x86_64-nacl/lib32", |
| + root_build_dir) ] |
| + } |
| + if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) { |
| + nmf_flags += [ "--library-path=" + |
| + rebase_path("${toolchain_dir}/x86_64-nacl/lib", |
| + root_build_dir) ] |
| + } |
| + } |
| + args = [ |
| + "--no-default-libpath", |
| + "--objdump=${toolchain_dir}/bin/x86_64-nacl-objdump", |
| + "--output=" + rebase_path(nmf, root_build_dir), |
| + "--stage-dependencies=" + rebase_path(root_build_dir), |
| + ] + nmf_flags + rebase_path(sources, root_build_dir) |
| deps = [ |
| - ":ppapi_nacl_tests_newlib", |
| + ":nacl_tests_copy", |
| ] |
| } |
| } |
| - group("ppapi_nacl_tests") { |
| + group("ppapi_nacl_tests_all") { |
| deps = [] |
| if (target_cpu == "x86" || target_cpu == "x64") { |
| - deps += [ ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})" ] |
| + deps += [ |
| + ":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})", |
| + ":generate_nmf(//build/toolchain/nacl:glibc_${target_cpu})", |
| + ] |
| } |
| } |
| } |