Skip to content

Instantly share code, notes, and snippets.

@roelds
Created January 5, 2023 00:30
Show Gist options
  • Save roelds/fabe8489be8f53751310b65c6dd1b11c to your computer and use it in GitHub Desktop.
Save roelds/fabe8489be8f53751310b65c6dd1b11c to your computer and use it in GitHub Desktop.
HowTo Build Brotli Windows

HowTo build / make latest brotli Windows 11 binary

I couldn't find latest brotli binary for Win64 / x64, so here is how to compile it on Windows, for Windows: https://github.com/google/brotli

Will use this repo later: https://github.com/Microsoft/vcpkg

Prerequisites

Install PowerShell Core:

https://aka.ms/powershell-release?tag=stable

Install Git for Windows:

https://gitforwindows.org

Install Visual Studio (free Community edition is ok):

http://visualstudio.net

Choose Workloads:

  • Desktop Dev with C++ (Optionals: add Win11SDK & also all with C++ in title, except those older than current MSVC)
  • Linux Dev with C++

Brotli

Run CMD as Admin:

C:
cd C:\
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg integrate install
.\vcpkg\vcpkg install brotli

Done. Find it here:

C:\vcpkg\packages\brotli_x86-windows\tools\brotli\brotli.exe
@roelds
Copy link
Author

roelds commented Sep 7, 2023

latest release now has windows binaries, but only build method that worked on linux is cmake:

# for Debian Testing, assuming WSL2 root container, running below as root

apt update
apt -y install cmake wget

wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz

gunzip v1.1.0.tar.gz
tar xvf v1.1.0.tar
cd brotli-1.1.0

mkdir out && cd out
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed ..
cmake --build . --config Release --target install

./brotli -V

# done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment