From 549ff935ab9bdf6a44b11c30f99e46e965bdf92c Mon Sep 17 00:00:00 2001 From: Kongqun Yang Date: Wed, 9 Oct 2013 17:07:10 -0700 Subject: [PATCH] Build script for packager. Also include .gitignore. Change-Id: Ib4788d653797f9ce3a6f99ea12859b8b1613a8d3 --- .gitignore | 6 ++++++ build.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ packager.gyp | 12 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 .gitignore create mode 100755 build.sh create mode 100644 packager.gyp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..55f93d26f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.cproject +.project +.pydevproject +.repo +.settings +out/* diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000..40db61d6f7 --- /dev/null +++ b/build.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# Copyright (c) 2013 Google Inc. All Rights Reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# ./build.sh {BuildType} {Module} +# +# The two parameters are optional, e.g. +# +# ./build.sh # build all modules in Debug mode. +# ./build.sh Release # build all modules in Release mode. +# ./build.sh Debug mp4 # build mp4 module in Debug mode. +# +# We use Ninja from Chrome to build our code. It's very very fast. +# +# A re-run of build.sh is required if there is any GYP file or build type +# change. Otherwise, you may just run Ninja directly: +# +# ninja -C out/Debug {Module} # Again, Module is optional. +# ninja -C out/Release {Module} # Again, Module is optional. + +function setup_packager_env() { + if [ $# -lt 1 ]; then + local type="Debug" + else + local type="$1" + if [[ "${type}" != "Release" && + "${type}" != "Debug" ]]; then + echo "Incorrect BUILDTYPE ${type}" + return + fi + fi + + export GYP_DEFINES="linux_use_gold_flags=0 use_openssl=1" + export BUILDTYPE="${type}" + + export BUILD_OUT="." + export GYP_GENERATOR_FLAGS="output_dir=${BUILD_OUT}" + tools/gyp/gyp --depth=. --generator-output=out -I build/common.gypi --no-circular-check packager.gyp +} + +export GYP_GENERATORS="ninja" +setup_packager_env $@ +ninja -C "out/${BUILDTYPE}" $2 diff --git a/packager.gyp b/packager.gyp new file mode 100644 index 0000000000..2fd7342975 --- /dev/null +++ b/packager.gyp @@ -0,0 +1,12 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'target_defaults': { + 'include_dirs': [ + '.', + ], + }, + 'targets': [ + ], +}