Skip to content

Instantly share code, notes, and snippets.

@steev
Forked from mohamed/build-gn.sh
Created October 1, 2017 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steev/801fb6a08313a3a7e00b1693903a0e47 to your computer and use it in GitHub Desktop.
Save steev/801fb6a08313a3a7e00b1693903a0e47 to your computer and use it in GitHub Desktop.
Build Google gn build tool standalone
#!/bin/bash
set -e
set -v
# Get the sources
mkdir gn-standalone
cd gn-standalone
mkdir tools
cd tools
git clone https://chromium.googlesource.com/chromium/src/tools/gn
cd ..
mkdir -p third_party/libevent
cd third_party/libevent
wget --no-check-certificate https://chromium.googlesource.com/chromium/chromium/+archive/master/third_party/libevent.tar.gz
tar -xvzf libevent.tar.gz
cd ../..
git clone https://chromium.googlesource.com/chromium/src/base
git clone https://chromium.googlesource.com/chromium/src/build
git clone https://chromium.googlesource.com/chromium/src/build/config
mkdir testing
cd testing
git clone https://chromium.googlesource.com/chromium/testing/gtest
cd ..
# Build
cd tools/gn
./bootstrap/bootstrap.py -s
# At this point, the resulting binary is at:
# gn-standalone/out/Release/gn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment