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

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

相关推荐
‎ദ്ദിᵔ.˛.ᵔ₎10 小时前
c++11:fuction包装器
开发语言·c++
霍霍的袁10 小时前
【C++】哈希表实现指南:从原理到开放定址法、链地址法的实现
c++·学习·哈希算法·散列表·visual studio
WL学习笔记12 小时前
类和对象(下)
c++·类和对象
傲世仙尊12 小时前
拷贝构造-传值传参的连锁反应与隐式函数的三个局限
c++
垆边人似月.12 小时前
华为机试题 :最大数
c++·算法·华为
方便面不加香菜13 小时前
C++ 关于多态的知识点讲解
开发语言·c++
jimy113 小时前
C++ 类成员函数的内联定义(inline)详解
开发语言·c++
sanqima14 小时前
CreateThread、_beginthreadex、AfxBeginThread三种线程创建的区别与联系
c++·tls·线程创建
sanqima14 小时前
依赖TLS和模块状态的MFC类
c++·mfc·tls·module state
All for pursuit.14 小时前
【动态规划-11】279.完全平方数
数据结构·c++·算法·leetcode·动态规划