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

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

相关推荐
紫陌涵光几秒前
77. 组合
c++·算法·leetcode·深度优先
肆忆_2 小时前
Day 04|线程安全引用计数:让 SharedPtr 支持并发拷贝/析构
c++
三水彡彡彡彡2 小时前
C++拷贝函数:const与引用的高效实践
开发语言·c++
D_evil__3 小时前
【Effective Modern C++】第七章 并发API:35. 优先考虑基于任务的编程而非基于线程的编程
c++
hansang_IR3 小时前
【记录】AT_abc406模拟赛
c++·算法·模拟赛
消失的旧时光-19434 小时前
C++ 多线程与并发系统取向(七)—— 并发排障与工程纪律(从“会写”到“能控场”)
开发语言·c++·并发
小老鼠不吃猫5 小时前
深入浅出(十三)QWT库——高稳定二维绘图
c++·qt·二维图
无忧.芙桃5 小时前
AVL树的实现
数据结构·c++
遥望九龙湖6 小时前
打包动态库
开发语言·c++·visualstudio