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

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

相关推荐
今天要早睡_4 小时前
C++15_deque与容器适配器复习
java·c++·rpc
@三十一Y4 小时前
C++高阶数据结构:图
开发语言·数据结构·c++
骑着蜗牛撵大象3275 小时前
从0实现C++ AI大模型接入SDK(十):DataManager业务实现——数据库CRUD、事务管理与数据一致性
数据库·c++·人工智能·sqlite·事务管理·数据一致性
金榜题名萱5 小时前
蓝桥杯 - 妮妮的月饼工厂(二分)
c语言·数据结构·c++·算法·蓝桥杯·动态规划
充电zcx6 小时前
C++ 复习:继承——访问规则、隐藏、多继承与虚继承
c++·继承·面向对象·多继承·虚继承
用户3900341061486 小时前
C++ 移动语义到底移走了什么?从 std::string 的 32 字节布局讲起
c++
ShineWinsu7 小时前
对于Qt:QSS样式属性的解析
开发语言·c++·qt·面试·盒子模型·客户端·qss
fpcc7 小时前
面试系列—虚函数常见的面试问题
c++·面试
不知棋者8 小时前
蓝桥杯 2020 省赛 B 组既约分数:从暴力枚举到欧拉函数前缀和
c++·算法·职场和发展·蓝桥杯
新知图书8 小时前
推荐一本 C++ 视觉开发书:《OpenCV 4.5 计算机视觉开发实战(基于 VC++)》,89 元,几十所高校在用
c++·opencv·计算机视觉