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

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

相关推荐
麦烤楽鸡翅1 小时前
简单迭代法求单根的近似值
java·c++·python·数据分析·c·数值分析
sulikey3 小时前
C++ 四十年:一段跨越时代的语言旅程
c++·c++40周年
-森屿安年-3 小时前
LeetCode 283. 移动零
开发语言·c++·算法·leetcode
散峰而望4 小时前
C++数组(一)(算法竞赛)
c语言·开发语言·c++·算法·github
FuckPatience6 小时前
C++ 常用类型写法和全称
开发语言·c++
__BMGT()7 小时前
参考文章资源记录
开发语言·c++·qt
ouliten7 小时前
C++笔记:std::string_view
开发语言·c++·笔记
玫瑰花店7 小时前
万字C++中锁机制和内存序详解
开发语言·c++·算法
D_evil__7 小时前
[C++高频精进] 文件IO:文件流
c++
西幻凌云7 小时前
认识STL序列式容器——List
开发语言·c++·stl·list·序列式容器