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

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

相关推荐
Keven_114 小时前
算法札记:ACM适用的很骚的C++语法(持续更新)
开发语言·c++
mengzhi啊4 小时前
QPluginLoader 动态 DLL 插件版,支持插件之间通信,广播。请求和应答
c++·qt
老赵的博客7 小时前
c++ QT之动态库加载问题
c++·qt
(Charon)8 小时前
【C++】定时器进阶:使用最小堆管理定时任务
c++·算法
hansang_IR8 小时前
【题解】 [省选联考 2021 A/B 卷] 卡牌游戏
c++·算法
lzx_0028 小时前
C++11(一)
开发语言·c++·算法
小七在进步10 小时前
C++入门(2)
java·jvm·c++
en.en..10 小时前
C语言核心解析:#define与typedef本质区别
开发语言·c++·算法
码匠许师傅11 小时前
【设计模式精讲】26.策略模式(Strategy)
c++·设计模式·策略模式·uml
果果燕11 小时前
实习笔记(六)主机按钮状态上报完整流程
开发语言·c++·php