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

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

相关推荐
AA陈超5 分钟前
Lyra项目中的输入系统
c++·笔记·学习·游戏·ue5·lyra
铅笔小新z6 分钟前
【C++】从理论到实践:类和对象完全指南(中)
开发语言·c++
千疑千寻~8 分钟前
【C++】std::move与std::forward函数的区别
开发语言·c++
hansang_IR14 分钟前
【记录】四道双指针
c++·算法·贪心·双指针
_OP_CHEN17 分钟前
算法基础篇:(十二)基础算法之倍增思想:从快速幂到大数据运算优化
大数据·c++·算法·acm·算法竞赛·倍增思想
Murphy_lx17 分钟前
C++ 条件变量
linux·开发语言·c++
xie0510_17 分钟前
C++入门
c++
AA陈超21 分钟前
ASC学习笔记0027:直接设置属性的基础值,而不会影响当前正在生效的任何修饰符(Modifiers)
c++·笔记·学习·ue5·虚幻引擎
羚羊角uou30 分钟前
【C++】智能指针
开发语言·c++
杜子不疼.35 分钟前
【C++】哈希表基础:开放定址法 & 什么是哈希冲突?
c++·哈希算法·散列表