Home > Net >  Getting error "libbrotli needed" when compiling woff2
Getting error "libbrotli needed" when compiling woff2

Time:10-11

I am trying to compile google/woff2 for 3 days but getting error "libbrotli needed". I was able compile brotli by running CMakeLists.txt in brotli folder and got .so files. I am beginner so I don't know to link both together. I want to compile and add brotli from CMakeLists.txt in woff2 folder or at least somehow compile linux build for woff2.

Thanks

CodePudding user response:

It seems like you need to compile and install brotli on your machine before you can compile google/woff2. The installation process is actually copying the .so and header file to somewhere on your system path that CMake is able to find it.

For example, you can you use this command to install the library to "/home/myuser/installdir"

cmake --install . --prefix "/home/myuser/installdir"

CodePudding user response:

Build woff2 with libbrotli included in the executable

woff2/README.md says:

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

I.e. the woff2 executable´s can be built and used in the woff2/ directory, or can be copied to any location.

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.

P.S.: Many of the "Linux OS" have woff2 (and libbrotli) available as a package, name = woff2 or woff2-tools.

  • Related