Граф коммитов

8 Коммитов

Автор SHA1 Сообщение Дата
brettw 41661dd32f GN: forward_variables_from shouldn't clobber vars.
The documentation for forward_variables_from specifies that it will give an error if the variable already exists in the target scope. But this was not implemented. Instead, the value would be silently overwritten.

This change implements the error, and fixes the times this happens in the Linux and Android builds.

Review-Url: https://codereview.chromium.org/1943583002
Cr-Original-Commit-Position: refs/heads/master@{#391136}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0785c950dce7221b10c21e911795e181076b90db
2016-05-03 01:09:10 +00:00
agrieve 4dcd0f9dd3 GN: Respect testonly in compiled_action and compiled_action_foreach
Also refactors them to use forward_variables_from()

BUG=

Review URL: https://codereview.chromium.org/1325783005

Cr-Original-Commit-Position: refs/heads/master@{#347162}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cdf0f11f9a64990b8f60f5df541525eaad434c6d
2015-09-03 15:59:32 +00:00
dpranke 6b94cd7a12 Update Chomium's build files to work w/ latest GN binaries.
The latest GN binaries rename cpu_arch to current_cpu and/or target_cpu
as appropriate, build_cpu_arch to host_cpu, and os to current_os and target_os as appropriate.

R=brettw@chromium.org
TBR=ddorwin@chromium.org
EXTRA_TRYBOTS=tryserver.chromium.linux:android_chromium_gn_compile_dbg,android_chromium_gn_compile_rel;tryserver.chromium.win:win8_chromium_gn_rel,win8_chromium_gn_dbg;tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg
BUG=344767

Review URL: https://codereview.chromium.org/913373002

Cr-Original-Commit-Position: refs/heads/master@{#317223}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4327621a322c964a8bc6d1ef5a4534f0f877d63e
2015-02-20 02:56:07 +00:00
scottmg fd96972e70 gn format //build
A starting point for doing all of src, and adding a PRESUBMIT.

Includes https://codereview.chromium.org/772663002/ and https://codereview.chromium.org/770053002/.
I haven't pushed new binaries yet.

Generated via:
> cd build
> git ls-files *.gn *.gni | sed -e "s/^/@..\\\\out\\\\Debug\\\\gn format --in-place /" >x.bat && x.bat

The only things that I don't love in the current output are:

1. Turning

    args = [
      "--depfile", rebase_path(depfile, root_build_dir),
      "--android-sdk-tools", rebased_android_sdk_build_tools,
      "--dex-path", rebased_output,
    ]

into:

    args = [
      "--depfile",
      rebase_path(depfile, root_build_dir),
      "--android-sdk-tools",
      rebased_android_sdk_build_tools,
      "--dex-path",
      rebased_output,
    ]

The heuristic for this isn't trivial though, and it also affects e.g. '-Xclang' in cflags, as well
as assignments to temporaries that are later assigned to args.

2. Turning single line

    if (defined(invoker.inputs)) { inputs = invoker.inputs }

into

    if (defined(invoker.inputs)) {
      inputs = invoker.inputs
    }

This could be argued to be an improvement, but as it's very boilerplate-y perhaps an exception to
allow single line in this case is worthwhile. I think there was discussion of new syntax for this
case too, something like "inputs ?= invoker.inputs" maybe.

In both cases, I think it's worthwhile to get formatting turned on, and then go back and special
case these if we decide it's worthwhile.

R=brettw@chromium.org
BUG=348474

Review URL: https://codereview.chromium.org/766573003

Cr-Original-Commit-Position: refs/heads/master@{#306305}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b199254f481c5db36d56e83fce40594b06d2b81f
2014-12-02 00:25:35 +00:00
Brett Wilson ccd33d0771 Minor fixes for the GN Windows build.
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/533853002

Cr-Original-Commit-Position: refs/heads/master@{#292979}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e1b05dc1d206abb5cd3fc0fdd549bd88eb5452a9
2014-09-02 19:57:57 +00:00
Brett Wilson 151cb2d170 Fix compiled action dependencies in GN.
The yasm uses of compiled action used sources instead of inputs. Sources applies to the _foreach version but not the plain "compiled_action". These did not trigger an unused variable warning because the declarations themselves dereferenced the sources variable for computing args to the script.

This adds some extra documentation and assertion to the compiled action template. It also adds the binary itself as an input. This should be strictly unnecessary since there should be an implicit dependency on the target, but I like this since it makes things more explicit.

R=ajwong@chromium.org

Review URL: https://codereview.chromium.org/505403002

Cr-Original-Commit-Position: refs/heads/master@{#292447}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4b04efb439a19c6dfef213a2fe51751b223f9cbd
2014-08-28 20:25:39 +00:00
brettw@chromium.org 28303e4e48 Rename source_prereqs to inputs in the GN build.
This variable changed name.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/375873006

git-svn-id: http://src.chromium.org/svn/trunk/src/build@282076 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-07-09 17:29:31 +00:00
brettw@chromium.org 2e63e4f6df Add yasm to the GN build.
This is forked off of https://codereview.chromium.org/266613002 The code to compile yasm itself is mostly from that patch, with a few updates for the other changes.

Adds a template for running compiled binaries. Compared to Albert's patch above, this assumes the binary is generated by the source tree so can have a cleaner interface (just specify the label of the tool you use).

The yasm rule is new compared to Albert's patch. It uses a special wrapper script instead of the new compiled_action templates so it can properly support depfiles. This also adds convenient support for defines and include dirs.

This adds some trivial ios changes to the content/public/browser. This should be a NOP now.

Fixes a bug in GN depfile creation. Previously, the .d file was emitted as an output of the script, but this confuses ninja. This change just removes that.

BUG=
R=ajwong@chromium.org

Review URL: https://codereview.chromium.org/321323004

git-svn-id: http://src.chromium.org/svn/trunk/src/build@276772 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-06-12 19:35:55 +00:00