build: [gn] centralize GN args under build/args/*.gn

Devs can still locally override or add settings by adding lines after
the `import` statement in args.gn.

This will help make sure that everyone has a common set of build args,
and will allow us to update everyone's build args in git.
This commit is contained in:
Jeremy Apthorp 2018-07-25 13:39:37 -07:00
Родитель d1cb8b7d67
Коммит 0efb5853d6
5 изменённых файлов: 20 добавлений и 12 удалений

Просмотреть файл

@ -354,17 +354,7 @@ jobs:
echo 'export SCCACHE_WRAPPER="'`pwd`'/libchromiumcontent/tools/sccache/aad2120/linux/sccache"' >> $BASH_ENV
echo 'export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools' >> $BASH_ENV
source $BASH_ENV
mkdir out/Default
cat > out/Default/args.gn <<-EOF
cc_wrapper = "$SCCACHE_WRAPPER"
root_extra_deps = [ "//electron" ]
is_electron_build = true
is_component_build = true
use_jumbo_build = true
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
EOF
gn gen out/Default
gn gen out/Default --args='import("//electron/build/args/debug.gn")'
- run:
name: Ninja build
command: |

10
build/args/all.gn Normal file
Просмотреть файл

@ -0,0 +1,10 @@
is_electron_build = true
is_electron_gn_build = true
root_extra_deps = [ "//electron" ]
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
enable_widevine = true
proprietary_codecs = true
ffmpeg_branding = "Chrome"

4
build/args/debug.gn Normal file
Просмотреть файл

@ -0,0 +1,4 @@
import("all.gn")
is_debug = true
is_component_build = true
use_jumbo_build = true

4
build/args/release.gn Normal file
Просмотреть файл

@ -0,0 +1,4 @@
import("all.gn")
is_component_build = false
is_official_build = true
is_component_ffmpeg = true

Просмотреть файл

@ -38,7 +38,7 @@ $ gclient sync --with_branch_heads --with_tags
```sh
$ cd src
$ export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
$ gn gen out/Default --args='root_extra_deps=["//electron"] is_electron_build=true is_component_build=true use_jumbo_build=true v8_promise_internal_field_count=1 v8_typed_array_max_size_in_heap=0'
$ gn gen out/Default --args='import("//electron/build/args/debug.gn")'
```
This will generate all the ninja files needed for the build. You shouldn't have