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

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

相关推荐
WL学习笔记12 小时前
C & C++ 内存管理
c++·c++内存管理
宛 禾14 小时前
Qt 控件入门:QLabel 从拖拽到对象树,一篇讲透
c++·qt·学习
hetao173383714 小时前
联盟场-提高组-R7 & ZYZSC-S-Round 11
c++·算法
程序喵大人14 小时前
【C++入门】编译链接模型 - 07 链接器怎样把符号对上号
开发语言·c++·编译器·编译链接·链接器
局部有解15 小时前
Hot100 - 三数之和
数据结构·c++·算法
longlongzihan15 小时前
C++ 常用数据结构速查:vector、stack、queue、list、树、图、哈希表等声明与核心操作
数据结构·c++·list
别动我齐刘海15 小时前
实时控制学习2
linux·c++·人工智能·学习·算法
hetao173383716 小时前
校内场-提高组 ZYZSC-S-Round 2
c++·算法
hetao173383717 小时前
2026-10-14 hetao1733837 的刷题记录
c++·算法
浅念-18 小时前
动态规划:线性DP——多状态DP与子数组专题笔记
c++·笔记·算法·leetcode·职场和发展·动态规划·力扣