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

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

相关推荐
Z1Jxxx1 小时前
01序列01序列
开发语言·c++·算法
坚定学代码2 小时前
基于观察者模式的ISO C++信号槽实现
开发语言·c++·观察者模式·ai
ha20428941943 小时前
Linux操作系统学习记录之---TcpSocket
linux·网络·c++·学习
AI视觉网奇4 小时前
ue5 插件 WebSocket
c++·ue5
左直拳4 小时前
将c++程序部署到docker
开发语言·c++·docker
恒者走天下4 小时前
AI智能体通讯项目(底层AI通讯协议实现)
c++
英雄各有见4 小时前
Chapter 5.1.1: 编写你的第一个GPU kernel——Cuda Basics
c++·gpu·cuda·hpc
梵尔纳多5 小时前
OpenGL着色器语言(GLSL)
c++·opengl·着色器
net3m335 小时前
单片机屏幕多级菜单系统之当前屏幕号+屏幕菜单当前深度 机制
c语言·c++·算法
mmz12075 小时前
二分查找(c++)
开发语言·c++·算法