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

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

相关推荐
Byte不洛3 分钟前
基于 C++ 手写 HTTP 服务器:从请求解析到响应构建全流程解析
linux·网络·c++·计算机网络·http
旖-旎8 分钟前
前缀和(和为K的子数组)(5)
c++·算法·leetcode·前缀和·哈希算法·散列表
不染尘.17 分钟前
背包问题BP
开发语言·c++·算法
2401_8747325319 分钟前
基于C++的爬虫框架
开发语言·c++·算法
lcj251123 分钟前
蓝桥杯C++:数据结构
数据结构·c++·算法
2401_8732046526 分钟前
C++代码重构实战
开发语言·c++·算法
xiaolang_8616_wjl31 分钟前
c++游戏_寻宝猎人_开源
开发语言·c++
暮冬-  Gentle°33 分钟前
C++中的策略模式应用
开发语言·c++·算法
Yungoal34 分钟前
1:const+volatile解决内存可见性问题,2:共享数据的访问导致竞争条件(Race Condition)
开发语言·c++·架构
2501_9454248037 分钟前
调试技巧与核心转储分析
开发语言·c++·算法