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

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

相关推荐
I Promise347 分钟前
多传感器融合&模型后处理C++工程师面试参考回答
开发语言·c++·面试
霍霍的袁35 分钟前
【C++初阶】函数重载详细讲解
开发语言·c++·算法
陌路2042 分钟前
详解C++ 高性能网络库 muduo 的精简日志模块
开发语言·c++·php
汉克老师1 小时前
GESP6级C++考试语法知识(二十七、广度优先搜索(二、二维BFS))
c++·算法·图论·宽度优先·广度优先搜索·gesp6级·gesp六级
此生决int1 小时前
算法从入门到精通——位运算
数据结构·c++·算法·蓝桥杯
春栀怡铃声1 小时前
【C++修仙录02】筑基篇:vector 使用
开发语言·c++·算法
丁劲犇1 小时前
使用TraeAI开发Web页面测试MSYS2 ucrt64 Qt MCP服务器
服务器·前端·c++·qt·mcp
码小猿的CPP工坊2 小时前
C++跨平台开发之基于wxWidgets开发GUI程序简介-001
开发语言·c++
故事和你912 小时前
洛谷-【动态规划1】动态规划的引入4
开发语言·数据结构·c++·算法·动态规划·图论