Skip to content

Instantly share code, notes, and snippets.

@terrafied
Forked from mohamed/build-gn.sh
Created November 14, 2017 18:35
Show Gist options
  • Save terrafied/e811eb6e974cde45a1d21e9fdb470d2c to your computer and use it in GitHub Desktop.
Save terrafied/e811eb6e974cde45a1d21e9fdb470d2c 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