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

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

相关推荐
fish_xk5 分钟前
c++基础扩展
开发语言·c++
阿沁QWQ7 分钟前
C++继承
开发语言·c++
啊吧怪不啊吧7 分钟前
C++之基于正倒排索引的Boost搜索引擎项目searcher部分代码及详解
c++·搜索引擎·项目
无限进步_37 分钟前
C语言实现贪吃蛇游戏详解
c语言·开发语言·数据结构·c++·后端·算法·游戏
CHANG_THE_WORLD41 分钟前
C++ vs Python 参数传递方式对比
java·c++·python
ULTRA??1 小时前
C++实现右折叠
开发语言·c++
handsomezqh1 小时前
洛谷U611548 助教的比拼
c++·算法
小李小李快乐不已1 小时前
图论理论基础(4)
c++·算法·图论·迭代加深
崇山峻岭之间1 小时前
C++ Prime Plus 学习笔记025
c++·笔记·学习
bkspiderx2 小时前
C++操作符优先级与结合性全解析
c++·思维导图·操作符优先级·结合性