0

我正在尝试编译google/woff2 3 天,但出现错误"libbrotli needed"。我能够通过在 brotli 文件夹中运行CMakeLists.txt来编译 brotli并获得 .so 文件。我是初学者,所以我不知道将两者联系在一起。我想在 woff2 文件夹中编译并添加来自CMakeLists.txt的 brotli,或者至少以某种方式为 woff2 编译 linux 构建。

谢谢

4

2 回答 2

1

看来您需要在您的机器上编译和安装 brotli才能编译google/woff2。安装过程实际上是将 .so 和头文件复制到 CMake 能够找到的系统路径上的某个位置。

例如,您可以使用此命令将库安装到“/home/myuser/installdir”

cmake --install . --prefix "/home/myuser/installdir"
于 2021-10-10T03:44:54.937 回答
0

使用包含在可执行文件中的 libbrotli构建woff2

woff2/README.md 说:

git clone --recursive https://github.com/google/woff2.git && cd woff2/ && make clean all

即 woff2 可执行文件可以在 woff2/ 目录中构建和使用,或者可以复制到任何位置。

cd new-Folder/ 
git clone --recursive
https://github.com/google/woff2.git 
cd woff2/ 
make clean all    ## brotli libs and woff2 are built ... together

## executable: {woff2_compress, woff2_decompress, woff2_info}

       ## compress example
./woff2_compress satluj.ttf 
Processing satluj.ttf => satluj.woff2
Compressed 45526 to 21423.

PS:许多“Linux 操作系统” woff2(和 libbrotli)都以包的形式提供,名称 =woff2woff2-tools.

于 2021-10-10T14:37:30.733 回答