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

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

相关推荐
神仙别闹13 分钟前
基于C++ MFC RSA 实现加密程序
开发语言·c++·mfc
Yzzz-F38 分钟前
CF2023D
c++·算法·dp
Mr.Lu ‍1 小时前
C++开发,使用openCV API对图片进行压缩
开发语言·c++·opencv
大鹏的NLP博客1 小时前
ONNX Runtime CUDA 推理优化实战:破解 C++ 比 Python 慢 28 倍的假象
c++·onnx·推理优化
HugoStudio_SWAN2 小时前
【按键反馈】C++ 实现键盘烟花秀
开发语言·c++·学习·程序人生
间歇性努力持续性发呆的野生快乐选手2 小时前
二分模板(整型,浮点型)
数据结构·c++·算法
艾莉丝努力练剑2 小时前
【AI大模型接入SDK】DeepSeek API 基础概述
c++·人工智能·学习·ai·面试·deepseek
ZiLing2 小时前
2026 ROS 2 Lyrical C++ 入门(一):rclcpp、QoS、colcon 与 CMake 踩坑指南
c++
OPEN-F2 小时前
C++进阶教程:类与对象深入
java·开发语言·c++
彷徨而立2 小时前
【C++11】内存模型的逻辑时序关系 happens‑before
c++