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

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

相关推荐
茉莉玫瑰花茶27 分钟前
C++ 17 详细特性解析(4)
开发语言·c++·算法
欧阳x天1 小时前
STL详解(九)—— stack和queue的模拟实现
开发语言·c++
dgaf1 小时前
【疯狂的往左】用 C 语言播放《下山》
c语言·c++
卷卷的小趴菜学编程1 小时前
项目篇----仿tcmalloc的内存池设计(central cache篇)
c++·tcmalloc·内存池·central cache
txinyu的博客1 小时前
解析muduo源码之 Channel.h & Channel.cc
c++
仰泳的熊猫2 小时前
题目1434:蓝桥杯历届试题-回文数字
数据结构·c++·算法·蓝桥杯
星火开发设计2 小时前
格式化输入输出:控制输出精度与对齐方式
开发语言·c++·学习·算法·函数·知识
ygklwyf2 小时前
模拟退火算法零基础快速入门
数据结构·c++·算法·模拟退火算法
zmzb01032 小时前
C++课后习题训练记录Day91
开发语言·c++
怡步晓心l2 小时前
Mandelbrot集合的多线程并行计算加速
c++·算法·缓存