Windows11下静态编译Skia库

xingyun86 3月前 334

Windows11下静态编译Skia库 

1.要先安装Python3,选择设置到环境变量里

2.下载LLVM(很多群友说vs编译的有问题)

https://github.com/llvm/llvm-project/releases

LLVM-15.0.7-win64.exe下载

安装到【E:\SkiaBuild\LLVM】目录

3.下载depot_tools

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

4.下载skia源码(E:\skiabuild)

git clone https://skia.googlesource.com/skia.git

depot_tools所在目录手动设置到环境变量中

5.同步依赖库

cd skia

python tools/git-sync-deps

如果有需要配置代理:

git config --global https.proxy 127.0.0.1:7890
git config --global http.proxy 127.0.0.1:7890
git config --global http.sslVerify false

6.修改gn\BUILDCONFIG.gn

if (target_os == "win") {

  # By default we look for 2017 (Enterprise, Pro, and Community), then 2015. If MSVC is installed in a

  # non-default location, you can set win_vc to inform us where it is.

  if (win_vc == "") {

    win_vc = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC"

  }

  assert(win_vc != "")  # Could not find VC installation. Set win_vc to your VC

                        # directory.

}

if (target_os == "win") {

  if (win_toolchain_version == "") {

    win_toolchain_version = "14.36.32532"

  }

  if (win_sdk_version == "") {

    win_sdk_version = "10.0.22621.0"

  }

  if (clang_win != "" && clang_win_version == "") {

    clang_win_version = "16"

  }

}

修改gn\toolchain\BUILD.gn

dlsymutil_pool_depth = 8

7.编译

本帖有隐藏内容,请您回复后查看。

本帖有隐藏内容,请您回复后查看。

8.编译完成

9.写个小例子展示一下效果(是个动画,Hello World会一直转圈)


×
打赏作者
最新回复 (1)
只看楼主
全部楼主
  • 吕旭州 26天前
    0 2

    厉害

返回