内容纲要

自己开发的项目使用 gn 来管理,需要一个 gn.exe 独立版,直接使用 chromium 的 depot_tools 中的 gn.bat 是不行的。
https://gn.googlesource.com/gn/ 去下载一个预编译版

生成 ninja 构建文件和 vs2017 项目

gn gen out\Default -ide=vs2017
ninja -C out\Default

输出编译参数

gn args --list out\Default

关闭 chromium 编译参数

target_cpu="x86"
is_official_build=true
symbol_level=0
ffmpeg_branding="Chrome"
proprietary_codecs=true
is_component_build=false

echo 'is_debug=false' >> out/Release/args.gn
echo 'clang_use_chrome_plugins=false' >> out/Release/args.gn
echo 'blink_gc_plugin=false' >> out/Release/args.gn
echo 'symbol_level=0' >> out/Release/args.gn

echo 'fatal_linker_warnings=false' >> out/Release/args.gn
echo 'treat_warnings_as_errors=false' >> out/Release/args.gn
echo 'remove_webcore_debug_symbols=true' >> out/Release/args.gn

echo 'enable_nacl=false' >> out/Release/args.gn
echo 'enable_media_remoting=false' >> out/Release/args.gn
echo 'enable_one_click_signin=false' >> out/Release/args.gn
echo 'enable_pdf=false' >> out/Release/args.gn
echo 'enable_basic_print_dialog=false' >> out/Release/args.gn
echo 'enable_basic_printing=false' >> out/Release/args.gn
echo 'enable_print_preview=false' >> out/Release/args.gn
echo 'safe_browsing_mode=0' >> out/Release/args.gn

echo 'use_cups=false' >> out/Release/args.gn
echo 'use_dbus=false' >> out/Release/args.gn
echo 'use_gconf=false' >> out/Release/args.gn
echo 'use_gio=false' >> out/Release/args.gn
echo 'use_gnome_keyring=false' >> out/Release/args.gn
echo 'use_gtk3=false' >> out/Release/args.gn
echo 'use_kerberos=false' >> out/Release/args.gn
echo 'use_libpci=false' >> out/Release/args.gn
echo 'use_pulseaudio=false' >> out/Release/args.gn
echo 'use_udev=false' >> out/Release/args.gn

echo 'cc_wrapper="ccache"' >> out/Release/args.gn

echo 'target_cpu="x86"' >> out/Release/args.gn
echo 'target_arch=ia32' >> out/Release/args.gn

参考

发表评论

电子邮件地址不会被公开。 必填项已用*标注