如何正确编译适用于Android的PDFium?

3

我正在尝试为Android构建PDFium。 我正在使用Debian stretch。

我执行了以下命令:

> mkdir build
> cd build
> mkdir build/source
> cd source
> gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
> echo "target_os = [ 'android' ]" >> .gclient
> gclient sync
> cd pdfium
> build/install-build-deps-android.sh

依赖安装完成后,我执行了以下命令:

> gn args wx/arm64/release

我将这些作为参数传入。
# Build arguments go here.
# See "gn args <out_dir> --list" for available build arguments.
target_os = "android"
target_cpu = "arm64"  # See "Figuring out target_cpu" below
use_goma = false  # Googlers only. Make sure goma is installed and running first. 
is_debug = false  # Enable debugging features.  
# Set true to enable experimental Skia backend. 
pdf_use_skia = false 
# # Set true to enable experimental Skia backend (paths only). 
pdf_use_skia_paths = false  
pdf_enable_xfa = false  # Set false to remove XFA support (implies JS support). 
pdf_enable_v8 = false  # Set false to remove Javascript support. 
pdf_is_standalone = true  # Set for a non-embedded build.  
is_component_build = true # Disable component build (Though it should work) # 
clang_use_chrome_plugins = false  # Currently must be false.
use_cxx11_on_android=false

我退出编辑器后,出现以下错误:

ERROR Unresolved dependencies.
//:pdfium_embeddertests__exec(//build/toolchain/android:android_clang_arm64)
  needs //build/android:cpplib_stripped(//build/toolchain/android:android_clang_arm64)
//:pdfium_unittests__exec(//build/toolchain/android:android_clang_arm64)
  needs //build/android:cpplib_stripped(//build/toolchain/android:android_clang_arm64)

你能帮我吗?

你有任何关于我在这里犯的错误的想法吗?是错误的配置吗?缺少依赖项吗?

非常感谢您能给我的任何帮助。

1个回答

3

我会回答自己的问题,以便其他人遇到相同的问题。

这是Pdfium构建脚本中的问题。

现在已经在Pdfium/master中得到修复(感谢Pdfium团队!)

如果您使用的是旧版本,则只需删除这些行即可。

if (is_component_build || is_asan) {
  data_deps += [ "//build/android:cpplib_stripped" ]
}

在文件 testing/test.gni 中


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接