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

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

相关推荐
布莱克6051 小时前
链表详解:定义、作用、应用场景及与数组的区别(C/C++ 实战)
c语言·开发语言·c++·链表
执子星海2 小时前
Registry Win32 API详解
c++·windows·microsoft·visualstudio·微软
江屿风3 小时前
C++OJ题经验总结(竞赛)5
开发语言·c++
zh路西法3 小时前
【玩转VLA具身智能机械臂】(三):视觉避障——从 RGB-D 点云到 MoveIt octomap 的完整落地
c++·ros2·gazebo·moveit2·ompl·octomap
2601_956121974 小时前
线性DP(入门)
c++·算法·动态规划
彷徨而立4 小时前
【C/C++】多线程读写普通 int 变量的一些问题
java·c语言·c++
蒸蒸yyyyzwd5 小时前
cpp web server 面试可能问题总结
c++·笔记·八股
啊啊啊啊啊!!!!5 小时前
【c++】map和set的使用
开发语言·c++
小灰灰搞电子5 小时前
分享自己写的一个通信协议源码,支持C++和C,双包头+不定长
c语言·开发语言·c++
Brilliantwxx5 小时前
【C++】初入嵌入式C++复习-----经典面试题100道
开发语言·c++·算法·面试·职场和发展