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

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

相关推荐
Demon--hx3 分钟前
多态实现原理
开发语言·c++
水饺编程39 分钟前
第5章,[Win32 章节] :绘制填充区域
c语言·c++·windows·visual studio
渡我白衣3 小时前
深入理解 Transformer:Transformer 究竟是什么?
java·linux·开发语言·c++·人工智能·深度学习·transformer
「QT(C++)开发工程师」11 小时前
C++ 11 常用for循环
开发语言·c++
我还记得那天11 小时前
0 初识C++
开发语言·c++
「QT(C++)开发工程师」13 小时前
C++ std::move 详解
开发语言·c++
豆沙沙包?15 小时前
C++~~~set容器、map容器(p57-P69)
开发语言·c++
qeen8716 小时前
【数据结构】哈希表的C++实现与封装
数据结构·c++·散列表·哈希表
乐观勇敢坚强的老彭18 小时前
C++信奥GESP四级的常见题型和解题模板速查表
开发语言·c++