1,安装"Debugging Tools for Windows“
Control Panel → Programs → Programs and Features → Select the “Windows Software Development Kit” → Change → Change → Check “Debugging Tools For Windows” → Change. Or, you can download the standalone SDK installer and use it to install the Debugging Tools.
2,gn gen out\Default
gn gen --ide=vs --filters=//chrome;//third_party/WebKit/*;//gpu/*
. --no-deps out\Default
输入参数:(gn args out/Default
) or on the gn gen command line (gn gen out/Default --args="is_component_build = true is_debug = true"
)
报错
ERROR at //cef/BUILD.gn:140:1: Assertion failed.
assert(!enable_print_preview)
可以键入命令输入编译参数: gn args out/Default 在弹出的编辑notepad里面加入一行:
enable_print_preview = false
enable_widevine = true
clang_use_chrome_plugins = false
这个文件保存在 out/Default/args.gn
加速:
is_component_build = true
- this uses more, smaller DLLs, and incremental linking.enable_nacl = false
- this disables Native Client which is usually not needed for local builds.target_cpu = "x86"
- x86 builds are slightly faster than x64 builds and support incremental linking for more targets. Note that if you set this but don‘t’ set enable_nacl = false then build times may get worse.blink_symbol_level = 0
- turn off source-level debugging for blink to reduce build times, appropriate if you don‘t plan to debug blink.
# Build arguments go here. # See "gn args <out_dir> --list" for available build arguments. enable_print_preview = false enable_widevine = true clang_use_chrome_plugins = false is_component_build = true enable_nacl = false target_cpu = "x86"
安装windows sdk
这个原因是因为新版的win10 sdk改变了目录结构,使得编译软件无法找到必要的处理程序。解决办法如下:
//chrome_elf/BUILD.gn:10:1: Can‘t load input file. import("//cef/libcef/features/features.gni") src/build.gn remove //cef
chrome_elf 移除 cef有关
原文:https://www.cnblogs.com/bigben0123/p/12554786.html