summarylogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
authornavigaid2019-09-30 16:20:45 +0000
committernavigaid2019-09-30 16:20:45 +0000
commit87e1a7cc9be306d9f9dd9ca2a2bf0c7f44cf3925 (patch)
treee64f2e7db9f8965cd2bcc33aa15324f5ceebbe99 /build.sh
parent51bf67239f6976bbd76b3b25fbb212a3772a1249 (diff)
downloadaur-87e1a7cc9be306d9f9dd9ca2a2bf0c7f44cf3925.tar.gz
build with system toolchain
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 000000000000..5e9d318e87bd
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+set -e
+
+export TMPDIR="$PWD/tmp"
+mkdir -p "$TMPDIR"
+
+if [ "$1" = debug ]; then
+ out=out/Debug
+ flags="$EXTRA_FLAGS
+ is_debug=true
+ is_component_build=true"
+else
+ out=out/Release
+ flags="$EXTRA_FLAGS
+ is_official_build=true
+ use_jumbo_build=true
+ exclude_unwind_tables=true
+ enable_resource_whitelist_generation=false
+ symbol_level=0"
+fi
+
+if which ccache >/dev/null 2>&1; then
+ export CCACHE_SLOPPINESS=time_macros
+ export CCACHE_BASEDIR="$PWD"
+ export CCACHE_CPP2=yes
+ flags="$flags"'
+ cc_wrapper="ccache"'
+elif [ -f "$HOME"/.cargo/bin/sccache* ]; then
+ export PATH="$PATH:$HOME/.cargo/bin"
+ flags="$flags"'
+ cc_wrapper="sccache"'
+fi
+
+flags="$flags"'
+ is_clang=true
+ linux_use_bundled_binutils=false
+
+ fatal_linker_warnings=false
+ treat_warnings_as_errors=false
+ use_sysroot=false
+
+ fieldtrial_testing_like_official_build=true
+
+ use_cups=false
+ use_dbus=false
+ use_gio=false
+ use_platform_icu_alternatives=true
+
+ disable_file_support=true
+ enable_websockets=false
+ disable_ftp_support=true
+ use_kerberos=false
+ disable_brotli_filter=true
+ enable_mdns=false
+ enable_reporting=false
+ include_transport_security_state_preload_list=false
+'
+
+if [ "$(uname)" = Linux ]; then
+ flags="$flags"'
+ use_ozone=true
+ ozone_auto_platforms=false
+ ozone_platform="headless"
+ ozone_platform_headless=true'
+fi
+
+rm -rf "./$out"
+mkdir -p out
+
+python2=$(which python2 2>/dev/null || which python 2>/dev/null)
+export DEPOT_TOOLS_WIN_TOOLCHAIN=0
+
+gn gen "$out" --args="$flags" --script-executable=$python2
+
+ninja -C "$out" naive