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

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

相关推荐
西西弗Sisyphus1 小时前
C++ 最小 Agentic Loop 实现 - 回调函数系列 - typedef 封装(4)
c++
笑鸿的学习笔记1 小时前
C++笔记之信号量和引用计数的概念是否等价?
java·c++·笔记
real_metrix3 小时前
【教程】C/C++ 基础系列 - 内存泄漏最佳实践
c++·c·内存泄漏
fqbqrr3 小时前
2612,C++协程
c++
treasure1404 小时前
Flutter低级教程(2027年1月重制版)
android·flutter·ios·gui·web·dart·移动端
纪念 2295 小时前
C++ 算法模板与错题 (差分)
开发语言·c++·算法
li星野5 小时前
C++/Qt 开发避坑与重构原则清单 (速记版)
c++·qt·重构
西西弗Sisyphus5 小时前
C++ 最小 Agentic Loop 实现 - 回调函数系列 - 函数指针详解(3)
c++
杜 硕5 小时前
从零开始的C++生活——第十六讲
开发语言·数据结构·c++·生活
沫璃染墨5 小时前
《Qt从零入门系列(十七):网络编程基础详解——从Socket原理到TCP/UDP通信API》
开发语言·网络·c++·qt·http·qt5·qt6.3