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

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

相关推荐
海盗猫鸥2 小时前
C++入门基础篇(1)
开发语言·c++·学习
Thunter_4 小时前
[QT入门]树形视图控件
开发语言·c++·qt
Chris-zz4 小时前
C++:继承
开发语言·c++·算法·学习方法
川爻5 小时前
String类(STL开始)
开发语言·c++
取加若则_5 小时前
C++入门(C语言过渡)
c语言·开发语言·数据结构·c++·算法
YangZheng@5 小时前
23种设计模式
c++·算法·设计模式
枫yy6 小时前
C++入门 容器适配器 / stack && queue模拟实现
开发语言·c++
溪渣渣_梁世华7 小时前
Qt 进程间通信(一)——QSharedMemory共享内存
c++·qt·进程间通信
程序员爱德华7 小时前
C++(week10):C++基础: 第二章 类与对象
c++·类和对象
小李很执着7 小时前
【掌握C++ string 类】——【高效字符串操作】的【现代编程艺术】
开发语言·c++·后端·学习