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

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

相关推荐
05候补工程师19 分钟前
【408 从零到一】线性表逻辑特征、存储结构对比与 C/C++ 动态内存分配避坑指南
c语言·开发语言·数据结构·c++·考研
怕什么真理无穷1 小时前
C++面试5_ TCP 粘包2(工业级)
开发语言·c++·tcp/ip
努力努力再努力wz1 小时前
【MySQL 进阶系列】拒绝滥用root:从 mysql.user 到权限校验,带你彻底理解用户管理与授权机制!
android·c语言·开发语言·数据结构·数据库·c++·mysql
雪度娃娃1 小时前
基于TCP的网络词典
网络·c++·tcp/ip·c#
春蕾夏荷_7282977252 小时前
2、c++ acl tcp服务器客户端简单实例-服务器端(1)
服务器·c++·tcp/ip
墨染千千秋2 小时前
C++if判断的使用全解
c++
雪度娃娃2 小时前
设计模式——单例模式
开发语言·c++·设计模式
Lenyiin2 小时前
《LeetCode 顺序刷题》61 - 70
java·c++·python·算法·leetcode·lenyiin
想唱rap2 小时前
应用层HTTPS协议
服务器·网络·c++·网络协议·http·https
_F_y3 小时前
仿RabbitMQ实现消息队列-客户端模块实现
c++·算法·rabbitmq