I've taken ad591c629a
and merged it onto Chromium ToT, with a few lint and other cleanups,
and one fix to make sure that Mac still compiled (which may have broken
iOS, haven't tested yet).
R=brettw@chromium.org, sdfresne@chromium.org
BUG=459705
CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg
Review URL: https://codereview.chromium.org/1250913002
Cr-Original-Commit-Position: refs/heads/master@{#342297}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2a29462a04dabad3fc20dc922227c46b36459912
There seem to be more compiler flags to tweak for other target
architectures, but with this I could at least build & run chrome_apk
with is_clang=true
BUG=402625
Review URL: https://codereview.chromium.org/1258923012
Cr-Original-Commit-Position: refs/heads/master@{#342227}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 91d9b7ee4e51168ef413265e33b8fe25253a1758
This ICU roll only renames component_mode -> is_component_build
Update other users of the component_mode string to is_component_build.
Rename the declaration to be local to BUILDCONFIG.gn (prefixed with '_').
Removes a bitrotted GN unit test around component handing (it wasn't
testing anything useful any more since we removed the built-in
component function).
Review URL: https://codereview.chromium.org/1275583002
Cr-Original-Commit-Position: refs/heads/master@{#342204}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2a08763777c45ca4e7a00a846266bbfed31ef673
Uses forward_variables_from for some obvious cases not including the Android build, and use the template() function in the component() definition.
Remove uses of component_mode since I want to delete that.
Review URL: https://codereview.chromium.org/1265263002
Cr-Original-Commit-Position: refs/heads/master@{#341767}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a09029884e02a3c027a485877886cf75969f6b3d
Now supporting various flavors of WinRT in the target_os argument.
Setting compiler and linker flags so cc files are compiled
to support C++/CX syntax.
This is part of a larger effort to port WebRTC to WinRT.
Review URL: https://codereview.chromium.org/1150183009
Cr-Original-Commit-Position: refs/heads/master@{#340893}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 56f81e32556d513af513eac0710f2e85877ffa3b
Do this by removing the default_warnings config, moving the flags in there to a
variable, and use it in both the chromium_code and no_chromium_code configs.
If a target does
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
this would add no_chromium_code to the end of configs previously, and the
-Wno-foo flags in default_warnings would be passed before the /W3 flag in
no_chromium_code (and /W3 would then override some of the -Wno-foo flags).
By moving the flags into no_chromium_code, they're guaranteed to appear
after /W3 (and after -Wall on POSIX).
See also thread "configs and warning cflag ordering" on gn-dev:
https://groups.google.com/a/chromium.org/forum/#!topic/gn-dev/qkqdlwtcQW4
In a similar vein, move a -Wno-foo flag in skia/BUILD.gn into a config, to make sure
it appears at the end of the compile command.
While here, also remove /wd4267 from skia's BUILD.gn, it's already passed globally
(this part doesn't change behavior).
(clang-cl working with gn also needs an ffmpeg roll to pick up
5eb7926d25
This is blocked on http://crbug.com/496975)
BUG=491209
CQ_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
Review URL: https://codereview.chromium.org/1151303006
Cr-Original-Commit-Position: refs/heads/master@{#333380}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0bfa8a8a759697b140ef2a18f058513ec8485a57
This is enough to get base building with clang on Windows.
On Windows, we use clang-cl.exe which is command-line compatible
with cl.exe.
BUG=491209,404525
CQ_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
Review URL: https://codereview.chromium.org/1158763006
Cr-Original-Commit-Position: refs/heads/master@{#332563}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 22c76db4a60e2e23c3f8f22f8e08b9b0cb49e002
The first pass of moving the other Chrome-specific build flags out of the root build config file and into the new one. This requires both ffmpeg and Blink changes to finish landing.
Originally landed as https://codereview.chromium.org/1120803003/TBR=scottmg@chromium.orgTBR=ddorwin@chromium.org (widevine)
CQ_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
Review URL: https://codereview.chromium.org/1123433002
Cr-Original-Commit-Position: refs/heads/master@{#327998}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2b2364bb2c6fbb88e6a4550abeb9141bc7cb949c
Now that os and cpu_arch are no longer needed or used anywhere.
R=brettw@chromium.org, rockot@chromium.org
BUG=344767
CQ_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
Review URL: https://codereview.chromium.org/1017273002
Cr-Original-Commit-Position: refs/heads/master@{#322499}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c329085593402937717484c073086cb1c904f37b
Makes chrome.dll on Windows not use incremental linking since the ilk files get too large.
This refactors the incremental linking configuration to make it easier to change the default.
BUG=
Review URL: https://codereview.chromium.org/1019353004
Cr-Original-Commit-Position: refs/heads/master@{#321585}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8900cf9444fc3e0adf6728926c96337ccadc9674
This should get most of NaCl and the PPAPI stuff needed
for NaCl building and linking. There is more work to be
done to get some of the test binaries working (and
probably fill out parts of the NaCl SDK) and possibly
some pnacl support work remaining as well.
NaCl is still disabled by default (set enable_nacl=true
to change). Enabling nacl is still mostly untested and
likely doesn't work at all :).
R=ncbray@chromium.org, brettw@chromium.org
BUG=432959
CQ_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
Review URL: https://codereview.chromium.org/877553008
Cr-Original-Commit-Position: refs/heads/master@{#318180}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6065cf751340a8a99b670357b2053ed6df12a7af
We would like to be able to default to the ARM CPU for
Android builds, not the host cpu (so that you can get the
default Android build by just specifying os="android");
prior to my cpu_arch -> target_cpu changes, this was the
case, but I accidentally broke this.
However, the target_cpu changes at least allow us to remove
the target_arch hack which was how they were accomplishing
this before :).
TBR=brettw@chromium.orgR=cjhopman@chromium.org
BUG=344767
CQ_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
Review URL: https://codereview.chromium.org/946683002
Cr-Original-Commit-Position: refs/heads/master@{#317419}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 55187fbe2d3264d4c31432e2f8a77f094d7c986b
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.orgTBR=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
The newest version of GN replaces the 'cpu_arch' and 'os' variables with 'current_cpu', 'target_cpu', 'current_os', and 'target_os', and also replaces 'build_cpu' with 'host_cpu', and 'build_os' with 'host_os'.
The roll also picks up the change to add a new 'gn clean'
command, some absolute path handling fixes, a check_includes fix for action_foreach(), and some minor
internal fixes.
This patch also updates the build config files to accommodate the GN changes in a backwards-compatible manner, i.e., the configs now will set cpu_arch and os correctly in the right contexts. They will also allow the users to continue to set os= and cpu_arch= in an args file, so no user builds (or bots) will break.
Once all of the bots and all of the build files have been updated to refer to the new variables instead of the old ones, we can drop the backwards-compatible versions.
TBR=brettw@chromium.org
BUG=344767
CQ_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
Review URL: https://codereview.chromium.org/936103003
Cr-Original-Commit-Position: refs/heads/master@{#317186}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7ee02bed35766535521c8e1f072b98cbf9eef53d
Hide JNI exported functions in Android binaries by default, unless the
target in question has explicitly set "use_native_jni_exports" to
indicate that it relies on the JVM's automatic symbol lookup mechanism.
The functions are simply demoted to hidden visibility; the code will
remain unless the linker determines that it is unreferenced and strips
it via --gc-sections.
This ensures that binaries by default actually test the explicit JNI
registration codepaths, which are required for compatibility with the
crazy linker, while still allowing binaries that do not require crazy
linker compatibility to choose to use the automatic mechanism in future.
BUG=442327
Review URL: https://codereview.chromium.org/843103003
Cr-Original-Commit-Position: refs/heads/master@{#316896}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9d90d85f73ca46847047ccbda270f25b637ccc86
Other misc fixes including:
Add "data_deps" to the templates in BUILDCONFIG. This was renamed from "datadeps" a while ago but both are still supported.
extension_management_test_util.cc includes a generated file policy_constants. GYP generates this with an extra "policy" directory but GN doesn't. The way GYP has the dirs set up, though, using only one "policy" works (and this is what other files do) so I just changed the include.
TBR=dpranke
Review URL: https://codereview.chromium.org/824373003
Cr-Original-Commit-Position: refs/heads/master@{#310276}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7d6ec24650eb3f6c7ab8dcfcf0c2829095951962
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
In order to run both the visual studio tools and the binaries built
by them (and ninja), we need to ensure that the VS runtime DLLs
are available in the path.
In the GYP build, we accomplish this by copying them into the
Debug and Debug_x64 dirs as appropriate inside the gyp_chromium
script.
In the pure-GN build, then, things would be broken, so we need to
modify the GN build to do the copy as well, or we need to inject
a step somewhere that happens after GN runs but before Ninja tries
to run (since none of the toolchain binaries will work).
This patch accomplishes this by calling out to vs_toolchain.py to
copy the DLLs as neede when the toolchain is defined. This is somewhat
less than ideal (makes 'gn gen' slower) but seems better than forcing
devs to have to run an additional command.
In addition, the GYP build writes targets into Debug and Debug_x64
concurrently. This doesn't really carry over into GN correctly, and
we probably only ever want to write targets into Debug and Debug/64
(or some such).
However, the way the toolchains are currently implemented, it's not
clear if this really works and the interplay between 32-bit and 64-bit
is weird (we apparently normally "force" 32-bit even if we set cpu_arch
to 64-bit, and require you to specify force_win64). To work around this
and make sure that we copy the right DLLs for the right arch into the
outer Debug/ directory, this patch temporarily disables the cross-arch
part of the build, forcing the host_toolchain to match the target_toolchain.
This likely means that 'cpu_arch="x86"' works (the default), but the 'host'
binaries like image_diff and mksnapshot will be compiled in 32-bit mode,
not 64-bit mode. 'cpu_arch="x64" force_win64=true' should also work, and
produce all-64-bit binaries. 'cpu_arch="x64"' does not work at all and
won't until we can clean up the above stuff.
R=scottmg@chromium.org, brettw@chromium.org
BUG=430661
Review URL: https://codereview.chromium.org/722723004
Cr-Original-Commit-Position: refs/heads/master@{#304310}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0b95195e49489b7a4d87048d2ce4b747173a5b8a
This fixes the following issue:
- allow forwarder2 to compile with clang
- Makes android executables position independant so that they can be run
on android devices
- Add missing BUILD.gn
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/684133002
Cr-Original-Commit-Position: refs/heads/master@{#302429}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cad816ee8f32cdec09c26bdc8fbbe881ceeb053d
This changes android to use the target_arch build arg for setting the
target architecture instead of cpu_arch.
Some benefits of this:
non-target toolchains have knowledge of the target architecture
(required for the relocation packer host executable)
allows us to have a default target_arch different from build_cpu_arch
BUG=359249,344767
Review URL: https://codereview.chromium.org/634403004
Cr-Original-Commit-Position: refs/heads/master@{#300136}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a7697bcfeed1dbbdafb419bc133e7d09774be485
The big changes here are:
1) Allow injecting of a target toolchain via args for os==chromeos.
2) For ARM builds, allow injecting -mtune and -mfloat-abi settings.
3) Allow injecting a pkg-config wrapper that correctly handles the
CrOS build environment. This is how pkg-config is handled for
all other packages in the build.
4) Create libmojo_sdk target, a static library of public Mojo code
suitable for distribution.
5) Added testonly = true to a few targets under mojo/ that are not
meant to be used in production.
BUG=388412
TEST=Create a target that builds //mojo/public, build with os==chromeos
Review URL: https://codereview.chromium.org/549453004
Cr-Original-Commit-Position: refs/heads/master@{#296849}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2c8e745d9c4de27b44f4d866a2bf0f0a880d9b8c
I went through and made "gn check //ui/*" pass, and did a lot of enhancements for the bugs I found.
Fixes a big bug in the header checker where it did not consider direct private dependencies to be OK from a header include perspective. However, private deps only change things when there are intermediate targets. This patch marks direct deps OK, and changes the variable names from is_public to is_permitted (since it may not actually be public).
Allow includes to be permitted if any target allows the include, rather than all of them. This happens if multiple targets have the same file as sources.
Strip the generated file directory from the beginning of sources. Previously, this was only for outputs (since typically they're included assuming the root gen dir is on the path). This comes up when an action generates a file, and then it's put into a source set (which we do a lot). This change allows a public dependency on the source set to count for header include purposes.
Track public/private deps in the dependency path finder so the error message can show which deps are private that break the chain. This was really helpful when tracking down errors.
Add deps and public deps to the build to make check pass.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/584683002
Cr-Original-Commit-Position: refs/heads/master@{#295783}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0380637c0085884d209fbbcaf0f0b0871fac162a
- Don't remove -fno-ident from gyp build (was added about 3y ago, seemingly unnecessary for current clang)
- Add -fno-slp-vectorize to GN to make builds match (both to be removed after next clang roll)
- Make usage of -Wno-reserved-user-defined-literal match (required for dbus pre-trusty)
- Add -march=x86-64 to gn cflags
- Default symbol_level based on is_debug, and turn it off by default in Release (same as gyp)
Also, fiddle with output of gyp_flag_compare.py.
R=brettw@chromium.org
BUG=335824
Review URL: https://codereview.chromium.org/562383002
Cr-Original-Commit-Position: refs/heads/master@{#294489}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 29682b848742042388ebd29c9df775f074c1414c
This changes the "test" template to create a shared_library (instead of
an executable) on Android. After this, we can actually run
base_unittests with
`build/android/test_runner.py gtest -s base_unnittests`
as normal (though may need to CHROMIUM_OUT_DIR and BUILDTYPE as
appropriate).
This requires adding the following targets:
//testing/android:native_test_native_code
//testing/android:native_test_util
//testing/android:native_test_jni_headers
//tools/android/md5sum:md5sum
//tools/android/md5sum:md5sum_bin
//tools/android/md5sum:md5sum_prepare_dist
//tools/android/md5sum:md5sum_copy_host
Also, makes it so that native executables are stripped (just like shared
libraries). Adds a simple create_native_execuatable_dist template that
sets up a dist directory for the executable (see
build/android/gyp/native_app_dependencies.gyp).
BUG=359249
TBR=rlarocque
Review URL: https://codereview.chromium.org/557463002
Cr-Original-Commit-Position: refs/heads/master@{#294032}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e65ead8fb1a1976682356cf824445476584e70f0
Previously "component" was a built-in function that forwarded to source_set, static_library, or shared_library depending on the value of component_mode. And test was a built-in function that forwarded to executable.
These can be expressed as templates instead. This patch removes the built-in versions and implements the templates in the master build config file.
Forwarding all of the variables for these is somewhat tedious, but I still prefer not to add a new concept for this, since it will be rarely used and less clear what is happening.
With the updated BUILDCONFIG.gn file, the build will work with both the old and new GN version (the built-in version of component and test take precedence). When the new GN binary is pushed, we can remove the references to component_mode.
BUG=
R=hclam@chromium.org
Review URL: https://codereview.chromium.org/516703005
Cr-Original-Commit-Position: refs/heads/master@{#292500}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 60a5bf4a8a5d1a2dad8e7a67f81e72756e886266
The previous code removed symbols from clang builds based on what GYP used to
do. But GYP changed this logic when clang was set to the default. GN was then
left with clang on by default, but no symbols.
This adds some additional GYP flag parity work.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/501173002
Cr-Original-Commit-Position: refs/heads/master@{#291803}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7927079955d2767e1fa812fe58432fcb9d6250aa
On Android, we detect neon support at runtime and switch implementations
based on that. This requires that some parts of skia are compiled with
-mfpu=neon.
To support this, the -mfpu flag is moved out of the 'compiler' config
and into its own config. A target can then remove this config and supply
its own -mfpu flag (without having to duplicate all the other stuff in
the 'compiler' config).
BUG=359249
Review URL: https://codereview.chromium.org/371853007
git-svn-id: http://src.chromium.org/svn/trunk/src/build@286038 4ff67af0-8c30-449e-8e8b-ad334ec8d88c