Index: ppapi/BUILD.gn |
diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn |
index 22498434f42217d2aecd25b867fab07a5beab19f..a89def35e6c50976c482868b05c800bd6641ebf9 100644 |
--- a/ppapi/BUILD.gn |
+++ b/ppapi/BUILD.gn |
@@ -152,6 +152,19 @@ source_set("ppapi_cpp_lib") { |
] |
} |
+shared_library("ppapi_cpp_lib_shared") { |
+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
brettw
2015/09/09 21:08:45
This needs to be inside
if (is_posix) { ... }
to
Petr Hosek
2015/09/09 22:14:50
Done.
|
+ sources = ppapi_sources.cpp_source_files |
+ sources += [ |
+ "cpp/module_embedder.h", |
+ "cpp/ppp_entrypoints.cc", |
+ ] |
+ cflags = [ "-fPIC" ] |
Dirk Pranke
2015/09/09 20:00:35
Presumably this is a linux/unix- specific flag and
Petr Hosek
2015/09/09 20:55:55
Actually, this is NaCl specific. After checking th
brettw
2015/09/09 21:08:45
This should be set already for Linux so you can ju
brettw
2015/09/09 21:19:19
Actually, this whole target is suspicious. ppapi_s
Petr Hosek
2015/09/09 22:14:49
Done.
|
+ deps = [ |
+ "//build/config/nacl:nacl_base", |
+ ] |
+} |
+ |
source_set("ppapi_gles2_lib") { |
include_dirs = [ "lib/gl/include" ] |
sources = [ |
@@ -183,6 +196,28 @@ if (enable_nacl) { |
] |
} |
+ executable("ppapi_nacl_tests_glibc") { |
+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
+ |
+ include_dirs = [ |
+ "lib/gl/include", |
+ "..", |
brettw
2015/09/09 21:08:45
Remove this, it's automatic in GN. Can you also re
Petr Hosek
2015/09/09 22:14:50
Done.
|
+ ] |
+ |
+ sources = ppapi_sources.test_common_source_files + |
+ ppapi_sources.test_nacl_source_files |
+ |
+ defines = [ "GL_GLEXT_PROTOTYPES" ] |
+ |
+ ldflags = [ "-pthread" ] |
Dirk Pranke
2015/09/09 20:00:35
same comment: presumably this will also need to ch
Petr Hosek
2015/09/09 20:55:55
ditto
|
+ |
+ deps = [ |
+ ":ppapi_cpp_lib_shared", |
+ "//ppapi/native_client/src/untrusted/irt_stub:ppapi_stub_lib", |
+ "//build/config/nacl:nacl_base", |
+ ] |
+ } |
+ |
copy("nacl_tests_copy") { |
sources = [ |
"${root_out_dir}/ppapi_nacl_tests_newlib.nexe", |
@@ -194,12 +229,65 @@ if (enable_nacl) { |
":ppapi_nacl_tests_newlib", |
] |
} |
+ |
+ copy("nacl_glibc_tests_copy") { |
+ sources = [ |
+ "${root_out_dir}/ppapi_nacl_tests_glibc.nexe", |
+ ] |
+ outputs = [ |
+ "${root_build_dir}/{{source_name_part}}_${target_cpu}.nexe", |
+ ] |
+ deps = [ |
+ ":ppapi_nacl_tests_glibc", |
+ ] |
+ } |
+ |
+ # TODO(phosek): We should really use toolchain_package from the toolchain |
+ # definition, but there is currently no way to access that variable. |
+ import("//build/config/nacl/nacl.gni") |
+ glibc_toolchain_dir = "${os_toolchain_dir}/nacl_x86_glibc" |
+ create_nmf = rebase_path("//native_client_sdk/src/tools/create_nmf.py") |
+ create_nmf_flags = [ |
+ "--no-default-libpath", |
+ "--objdump=${glibc_toolchain_dir}/bin/x86_64-nacl-objdump", |
+ ] |
+ |
+ action("generate_glibc_nmf") { |
+ glibc_nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf" |
+ script = create_nmf |
brettw
2015/09/09 21:08:45
Since you only use this var once, inline it here.
Petr Hosek
2015/09/09 22:14:49
I'm going to be using it in the future for PNaCl a
|
+ sources = get_target_outputs(":nacl_glibc_tests_copy") |
+ outputs = [ |
+ glibc_nmf, |
+ ] |
+ glibc_nmf_flags = [ "--library-path=" + rebase_path(root_out_dir) ] |
+ if (current_cpu == "x86") { |
+ libdir_glibc32 = "${glibc_toolchain_dir}/x86_64-nacl/lib32" |
+ glibc_nmf_flags += |
+ [ "--library-path=" + rebase_path(libdir_glibc32, root_build_dir) ] |
+ } |
+ if (target_cpu == "x64" || (target_cpu == "x86" && is_win)) { |
+ libdir_glibc64 = "${glibc_toolchain_dir}/x86_64-nacl/lib" |
+ glibc_nmf_flags += |
+ [ "--library-path=" + rebase_path(libdir_glibc64, root_build_dir) ] |
+ } |
+ args = [ |
+ "--output=" + rebase_path(glibc_nmf, root_build_dir), |
+ "--stage-dependencies=" + rebase_path(root_build_dir), |
+ ] + create_nmf_flags + glibc_nmf_flags + |
brettw
2015/09/09 21:08:45
Since this is only used once, can you delete the c
Petr Hosek
2015/09/09 22:14:49
There is going to be another invocation in the fut
|
+ rebase_path(sources, root_build_dir) |
+ deps = [ |
+ ":nacl_glibc_tests_copy", |
+ ] |
+ } |
} |
group("ppapi_nacl_tests") { |
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_glibc_nmf(//build/toolchain/nacl:glibc_${target_cpu})", |
+ ] |
} |
} |
} |