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

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

相关推荐
小小龙学IT4 分钟前
snap7 开源西门子 S7 通信协议库深度解析
c++·开源
小溪学编程1 小时前
从 C++ 的规范变迁看语言发展
jvm·c++·面试
ShineWinsu2 小时前
对于Redis:string类型的解析
java·c++·redis·分布式·缓存·面试·string
YYYing.3 小时前
【设计模式系列 (七) 】桥接模式
c++·后端·设计模式·桥接模式
高山有多高3 小时前
【Linux笔记】Linux自定义Shell
linux·c++
悠仁さん4 小时前
【C++】vector 类
开发语言·c++
_upupup4 小时前
智能指针的原理及简单模拟实现(C++)
开发语言·c++
l1t4 小时前
DeepSeek总结的OpenZL压缩变换器
c++·算法
郝学胜-神的一滴4 小时前
C++ Templates 01:拨开迷雾,读懂C++模板经典著作
开发语言·c++·程序人生·游戏·游戏引擎·软件构建
坤坤子吖4 小时前
算法学习——高精度加减乘除
c++·笔记·学习·算法