Skia最新版CMake编译

运行示例:example/HelloWorld.cpp

Skia:

2024年03月08日

master分支: 993a88a663c817fce23d47394b574e19d9991f2f

使用CMake编译

复制代码
python tools/git-sync-deps

bin/gn gen out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py

此时output目录会生成CMakeLists.txt

可能的报错

  • macOS可能缺少libuuid
    报错:

    #define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48)

    struct JournalInfoBlock {
    u_int32_t flags;
    u_int32_t device_signature[8]; // signature used to locate our device.
    u_int64_t offset; // byte offset to the journal on the device
    u_int64_t size; // size in bytes of the journal
    uuid_string_t ext_jnl_uuid;
    char machine_serial_num[48];
    char reserved[JIB_RESERVED_SIZE];
    } attribute((aligned(2), packed));
    typedef struct JournalInfoBlock JournalInfoBlock;

解决:

复制代码
brew install libuuid

编译和运行示例

复制代码
cd skia
mkdir -p out/config/build
cd out/config/build

cmake ..
make HelloWorld -j32
./HelloWorld

即可得到文章开头的截图。

相关推荐
石去皿21 小时前
从本地知识库到“活”知识——RAG 落地全景指南
c++·python·大模型·rag
橘颂TA21 小时前
【剑斩OFFER】算法的暴力美学——力扣 844 题:比较含退格的字符串
数据结构·c++·算法·力扣·结构与算法
自然数e1 天前
c++多线程【多线程常见使用以及几个多线程数据结构实现】
数据结构·c++·算法·多线程
fy zs1 天前
网络基础概念
linux·网络·c++
另寻沧海1 天前
VS Code 内置变量与配置文件完全指南
c++·vscode
南桥几晴秋1 天前
Qt显示类控件
开发语言·c++·qt
威桑1 天前
交叉编译过程中的踩坑与收获
linux·c++·arm·交叉编译
君义_noip1 天前
信息学奥赛一本通 1951:【10NOIP普及组】导弹拦截 | 洛谷 P1158 [NOIP 2010 普及组] 导弹拦截
c++·算法·csp-j·信息学奥赛
空空潍1 天前
hot100-滑动窗口最大值(day11)
数据结构·c++·算法·leetcode
朔北之忘 Clancy1 天前
2025 年 6 月青少年软编等考 C 语言一级真题解析
c语言·开发语言·c++·学习·算法·青少年编程·题解