首页 > 系统相关 >windows下编译pdfium

windows下编译pdfium

时间:2023-02-21 19:45:09浏览次数:57  
标签:git false windows tools pdfium 编译 pdf true

当前流程截至2023/2/20有效

1、提前安装好工具链

VS2017 + SDK Win10 SDK 10.0.20348 + Git for windows + tortoisegit + 代理

2、下载depot_tools

命令行中设置环境变量:

set http_proxy=http://127.0.0.1:1080

set https_proxy=https://127.0.0.1:1080

# 设置git代理

git config --global http.proxy http://127.0.0.1:1080

git config --global https.proxy https://127.0.0.1:1080

下载 depot_tools 源码; 
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
下载完成后,将下载的 depot_tools 源码目录添加系统环境变量之中,并且添加以下环境变量:

vs2017_install=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise

命令行进入depot_tools\\bootstrap目录,执行win_tools.bat自动下载编译工具。

注意:每次打开一个cmd执行命令时务必设置好环境变量及代理。

3、下载 PDFium 源码;

额外再设置环境变量:

set DEPOT_TOOLS_WIN_TOOLCHAIN=0

set GYP_MSVS_VERSION=2017

set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git

这个过程中会报proxy_compiler is not running,不用管。
gclient sync

4、编译

进入 PDFium 源码目录,
在命令行上输入:gn args out/x64,此时会弹出编译选项文本,要你输入。不输入默认生成 x64、动态库版本
在命令行上输入:ninja -C out/x64 pdfium,进行编译。
编译过程会根据编译选项不同,花费的时间不同。

部分编译选项:

#是否启用 goma 支持
use_goma = false

# 是否编译为 Chrome 插件
clang_use_chrome_plugins = false

#是否进行编译测试
pdf_is_standalone = true

#是否启用 skia 支持
pdf_use_skia = false

#true 编译为 debug 版本,false 编译为 release 版本
is_debug = false

#true 编译为动态库,false 编译为静态库
is_component_build = true

#编译为一个独立的静态库(is_component_build 必须为 false)
#pdf_is_complete_lib 为 false 时, 编译为多个静态库,true 编译为一个独立的静态库
pdf_is_complete_lib = false

#xfa 支持
pdf_enable_xfa = false

#v8 支持;启用 v8 后,编译时间会增加
pdf_enable_v8 = true

#cpu 架构;x86、x64 可选
target_cpu = "x64"

#true 将用 clang 进行编译,false 将用 VS2017 编译
is_clang = true

 

标签:git,false,windows,tools,pdfium,编译,pdf,true
From: https://www.cnblogs.com/csstudy/p/17142170.html

相关文章