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

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

相关推荐
wunaiqiezixin4 小时前
如何在C++中创建和管理线程
c++
雪度娃娃5 小时前
转向现代C++——在意为改写的函数添加 override
开发语言·c++
王老师青少年编程5 小时前
csp信奥赛C++高频考点专项训练之前缀和&差分 --【一维差分】:[NOIP 2018 提高组] 铺设道路
c++·前缀和·差分·csp·高频考点·信奥赛·铺设道路
星马梦缘5 小时前
aaaaa
数据结构·c++·算法
喵星人工作室6 小时前
C++火影忍者1.1.2
开发语言·c++
basketball6166 小时前
C++ 中的 ptrdiff_t 详解
开发语言·c++
wunaiqiezixin6 小时前
互斥锁与自旋锁的区别
c++
代码中介商6 小时前
深入解析STL中的stack、queue与priority_queue
开发语言·c++
磊 子8 小时前
STL无序关联容器—unorded_set+unorded_map
开发语言·c++
初夏睡觉8 小时前
数据结构学习之~二叉堆 (P3378 【模版】堆)
数据结构·c++·学习