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

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

相关推荐
一只旭宝6 小时前
C++ 后端开发面试题整理
java·c++·面试
xlq223226 小时前
全面复习1
c++
Dylan的码园6 小时前
求平均成绩 矩阵数据处理 【循环处理 二维数组】
c++·线性代数·矩阵
All for pursuit.6 小时前
【回溯-2】22.括号生成
数据结构·c++·算法·leetcode
longlongzihan7 小时前
LeetCode 1004.最大连续1的个数III 滑动窗口及动态规划题解
c++·算法·leetcode·dp·滑动窗口
朝朝辞暮i7 小时前
C++ 第 22 课:const —— 不允许随便修改的数据
开发语言·c++·算法
蒸蒸yyyyzwd7 小时前
力扣二分总结-lowerbound
c++
ShineWinsu7 小时前
对于Redis:List类型的解析
数据库·c++·redis·链表·缓存·面试·list
小师兄吃牛肉8 小时前
C++ 与 Lua 的协程交互:从原理到实战
c++·lua·交互