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

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

相关推荐
带土12 分钟前
8. C++ explicit 关键字
开发语言·c++
im_AMBER3 分钟前
Leetcode 103 反转链表 II
数据结构·c++·笔记·学习·算法·leetcode
十五年专注C++开发38 分钟前
CMake基础:foreach详解
linux·c++·windows·cmake·跨平台编译
小黄鸭code1 小时前
C++ 算法笔试题(常见算法版)
c++·算法·排序算法
lihao lihao1 小时前
C++ set和map
开发语言·c++·算法
学嵌入式的小杨同学1 小时前
顺序表(SqList)完整解析与实现(数据结构专栏版)
c++·算法·unity·游戏引擎·代理模式
我就想睡到自然醒1 小时前
【C++基础STL1】数组和vector
c++
玖釉-1 小时前
[Vulkan 学习之路] 04 - 选妃环节:挑选物理设备与队列族
c++·windows·图形渲染
三万棵雪松2 小时前
【AI小智硬件程序(九)】
c++·人工智能·嵌入式·esp32·ai小智
HABuo2 小时前
【linux进程控制(一)】进程创建&退出-->fork&退出码详谈
linux·运维·服务器·c语言·c++·ubuntu·centos