windows编译skia

set GYP_MSVS_VERSION=2017
set vs2017_install=D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
set GYP_MSVS_OVERRIDE_PATH=D:\Program Files (x86)\Microsoft Visual Studio\2017\Community
set GYP_GENERATORS=msvs-ninja,ninja
set WINDOWSSDKDIR="D:\Windows Kits\10"
set DEPOT_TOOLS_WIN_TOOLCHAIN=0

set win_vc = "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
set win_sdk = "D:\Windows Kits\10"

REM 解决拷贝icudtl.dat错误
set "PATH=%PATH%;D:\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin"

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

1.克隆代码

git clone https://github.com/google/skia

2.下载依赖,需要额外的网络 

python2 tools/git-sync-deps

3.如果vs安装的目录不在C盘,修改一下gn/find_msvs.py文件,指定vs目录

default_dir = r'D:\Program Files (x86)\Microsoft Visual Studio',

4.指定windowssdk安装目录,需要额外下载windows sdk,自带的不能用,找不到stddef.h等文件

指定sdk路径 修改gn/BUILDCONFIG.gn

win_sdk = "D:/Windows Kits/10"

5.把上边的编译指令拷贝到build.bat中

build.bat

 

你可能感兴趣的:(skia)