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

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

相关推荐
西西弗Sisyphus9 分钟前
C++ 最小 Agentic Loop 实现 - 开始实现 完整的内容
开发语言·c++
天威?*1 小时前
团体程序设计天梯练习集L3-001 凑零钱
数据结构·c++
充值内卷2 小时前
Varsar:一个 5.7 MB 的免安装文件对比工具
c++·比较工具
wo_jack3 小时前
C++ 入门笔记(二十):stack / queue 的模拟实现 —— 适配器与 deque 底层
c++·stl·deque·queue·stack
_dindong3 小时前
仿muduo库实现高并发服务器 -通用类型Any类型的实现
服务器·c++
不在逃避q4 小时前
用生活里的小场景,一键打开 C++ 编程入门大门
开发语言·c++·生活
YSL0701244 小时前
C++string类详解
开发语言·数据结构·c++
郝学胜-神的一滴4 小时前
量化交易从入门到精通 04:量化生意的四大特点
开发语言·数据结构·c++·python·算法·pycharm
青少儿编程课堂4 小时前
蓝桥杯青少组图形化真题:校园失物招领智能匹配解析(全国青少年信息素养、电子学会图形化考级同源考点)
c++·python·算法·bfs·信息学竞赛
程序猿编码5 小时前
不依赖第三方推理框架:端侧大模型 CUDA 原生推理实现与性能踩坑复盘
c++·llm·大模型推理