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

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

相关推荐
坤坤子吖7 分钟前
Linux 线程概念与控制——线程创建、退出与等待
linux·开发语言·c++·笔记·学习
weixin_3077791312 分钟前
C++代码实现MATLAB中的fitnlm函数功能
开发语言·c++·算法·matlab
雪落漂泊16 分钟前
C++算法:双指针篇(下)
数据结构·c++·算法
所以遗憾是什么呢?10 小时前
【题解】Educational Codeforces Round 195 (Rated for Div. 2) ABCDE
c++·动态规划·acm·icpc·ccpc·xcpc·codeforecs
Lhan.zzZ11 小时前
Qt WebEngineView 在 Linux 上无法加载网页:从“看不见 HTML“到“禁用沙箱“
linux·c++·qt
sysu_chenxy13 小时前
二重循环输出二维图形
c++
划破黑暗的第一缕曙光14 小时前
[C++]:2.类和对象(下)
c++·类和对象·对象·类
黎相思16 小时前
LRU Cache
c++·缓存
UIU11416 小时前
P1003 [NOIP 2011 提高组] 铺地毯
数据结构·c++·算法
xxwl58517 小时前
区域赛算法模版第四章---数据结构
数据结构·c++·算法