you can skip this, if your do not want use a proxy server.
git config --global http.proxy=http://127.0.0.1:1080
git config --global https.proxy=http://127.0.0.1:1080
git clone -b build_for_vs2015 https://github.com/elfive/skia_vs2015.git
and we assume your skia code is locate at C:\Users\yourname\Desktop\skia_vs2015
only version 2.7.x works here, and don't forget to add python.exe to your system PATH variable.
python 2.7.18 for windows 64bit download:https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi
then you should add those paths to your system PATH environment variable
C:\Users\yourname\Desktop\skia_vs2015\bin
C:\Users\yourname\Desktop\skia_vs2015\depot_tools
or just export at the same terminal(batch file or cmd.exe) if you don't want change system configure:
set PATH=%PATH%;C:\Users\yourname\Desktop\skia_vs2015\bin;C:\Users\yourname\Desktop\skia_vs2015\depot_tools
using skia git-sync-deps sync command in your skia directory
python tools/git-sync-deps
it will download all the build tools and skia dependencies needed for build skia. so make sure all the content are correctly downloaded.
you can verify it by just rerun the git-sync-deps command, it will show all dependencies and it's version or commit id.
-
404 or can not find git repo issue:
for vs2015 build we can only use old version of skia and old dependencies, and maybe some old dependencies removed by google, so we need to modify
skia_vs2015/DEPS, to some alternative repo(always remember version number or commit id after @ should not be changed.)for those deleted repo can no longer download, you could find mirror repo at github.com. we recomand two users, if you need to do so, most outdated repo can be found at their repo list:
https://github.com/onlyyou2023 https://github.com/GoogleDependsafter you modified
DEPS, rerungit-sync-depscommand, until all the contents are downloaded ccorrectly. -
xxx is not a git directoryerrorfirst delete the directory(if you don't know where it is, you can find it in
skia_vs2015/DEPSfile.), you should rerungit-sync-depscommand after doing so.
we use bin/gn gen command to generate vs sln file, if you don't know how to use it, you should head to this web page or this web page to find answers for yourselves.
gn gen vs2015/static_release_x64 --args='is_component_build=false is_official_build=true target_cpu=\"x64\" skia_enable_discrete_gpu=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=false skia_enable_gpu=false extra_cflags=[\"/MD\"]' --ide=vs --sln=skia
gn gen vs2015/static_release_x86 --args='is_component_build=false is_official_build=true target_cpu=\"x86\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=false skia_enable_gpu=false extra_cflags=[\"/MD\"]' --ide=vs --sln=skia
gn gen vs2015/static_debug_x86 --args='is_component_build=false is_official_build=false target_cpu=\"x86\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=true skia_enable_gpu=false extra_cflags=[\"/MDd\"]' --ide=vs --sln=skia
gn gen vs2015/static_debug_x64 --args='is_component_build=false is_official_build=false target_cpu=\"x64\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=true skia_enable_gpu=false extra_cflags=[\"/MDd\"]' --ide=vs --sln=skia
files can be founded whthin skia_vs2015/vs2015 directory
we generate
gn gen vs2015/dynamic_release_x64 --args='is_component_build=true is_official_build=true target_cpu=\"x64\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=false skia_enable_gpu=false extra_cflags=[\"/MD\"]' --ide=vs --sln=skia
gn gen vs2015/dynamic_release_x86 --args='is_component_build=true is_official_build=true target_cpu=\"x86\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=false skia_enable_gpu=false extra_cflags=[\"/MD\"]' --ide=vs --sln=skia
gn gen vs2015/dynamic_debug_x86 --args='is_component_build=true is_official_build=false target_cpu=\"x86\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=true skia_enable_gpu=false extra_cflags=[\"/MDd\"]' --ide=vs --sln=skia
gn gen vs2015/dynamic_debug_x64 --args='is_component_build=true is_official_build=false target_cpu=\"x64\" skia_enable_pdf=false skia_enable_pdf=false skia_enable_effects=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_egl=false skia_use_angle=false skia_use_expat=false skia_use_dng_sdk=false is_debug=true skia_enable_gpu=false extra_cflags=[\"/MDd\"]' --ide=vs --sln=skia
files can be founded whthin skia_vs2015/vs2015 directory
just open the skia.sln file and then compile project skia, after that you can find the skia.lib binary at the same directory of skia.sln
-
modify the
toolchain.ninjafile locate at the same directory ofskia.sln, replace all the content(like below)cmd /c C:/Program Files (x86)/Microsoft Visual Studio 14.0/win_sdk/bin/SetEnv.cmd /x86 && C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64_x86/to this(notice that there is a space' ' behind &&):
cmd /c vcvarsall.bat x86 && -
then add this paths to your system variables(or just export it should do the same work):
the path may different if you installed your visual studio to a different location.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\ -
open the
skia.slnfile and then compile projectskia, after that you can find theskia.libbinary at the same directory ofskia.sln
if you do not wanna show the include info whild compile skia, you just need modify the toolchain.ninja file, delete all the /showIncludes options.
copy skia_vs2015/include folder to whatever you like, setup the include paths for your project, then link skia.lib, and you should be ok.