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

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

相关推荐
无忧.芙桃5 分钟前
debug实例与分析(一)
开发语言·c++·算法
alwaysrun8 分钟前
C++之类型安全格式化format
c++·程序员·编程语言
邪修king11 分钟前
C++ 哈希表超全详解:从底层实现到封装 myunordered_map/myunordered_set
c++·哈希算法·散列表
secret_to_me14 分钟前
buildRoot编译rootfs实战
linux·c语言·c++·ubuntu·电脑·buildroot
凡人叶枫15 分钟前
Effective C++ 条款01:视 C++ 为一个语言联邦
linux·开发语言·c++·effective c++·编程范式·语言联邦
QiLinkOS21 分钟前
合肥气链科技有限公司本质总结
c++·科技·算法·gitee·开源
Yuk丶23 分钟前
厌倦了假AI对话?本地 LLM 语音对话 + 口型同步系统 2.0(已开源!)
c++·人工智能·语言模型·开源·ue4·语音识别·游戏开发
kyle~33 分钟前
ROS2---零拷贝
linux·c++·机器人·ros2
Ricky_Theseus36 分钟前
栈 & 队列 应用场景
数据结构·c++
薇茗37 分钟前
【C++】类与对象 核心篇
开发语言·c++