DescriptionGN: New conventions, default target and refactorings
Introduce a convention on categorizing GN targets:
1. Production code
2. Tests
3. Examples
4. Tools
The first two have targets spread out all over the tree,
while the latter are isolated to examples/ and tools/ directories.
Another new convention: Each directory's BUILD.gn file shall contain
a target named similar to the directory name. This target shall
contain the 'most common' production code, i.e. so that most
consumers of the directory can depend on only the directory
(which implicitly means that target in GN).
//webrtc:webrtc_tests is changed to depend on all WebRTC tests.
From now on, it's necessary to add new test targets to this dependency
tree in order to get them compiled.
Two new group targets are created:
//webrtc/modules/audio_coding:audio_coding_tests
//webrtc/modules/audio_processing:audio_processing_tests
to reduce the long list of tests in //webrtc:webrtc_tests.
Visibility on //webrtc:webrtc and //webrtc:webrtc_tests is restricted
to the root target, to avoid circular dependencies due to the monolithic
property of these targets (a problem we've had in the past).
The 'root' target at the top level is renamed to 'default', which means GN will
build this target instead of _all_ generated targets
(see https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/faq.md#Can-I-control-what-targets-are-built-by-default).
This target now depends on everything we want to build, meaning all targets now
explicitly needs to be wired up from the root target in order to get build.
Having this, the number of compiled objects on Android is decreased from 8855 to 6276. It also gives us better control over our build.
BUG=webrtc:6440
TESTED=git cl try --clobber
NOTRY=True
Committed: https://crrev.com/6ceab083225dfa485bb48f9e43231c216acccbaf
Cr-Commit-Position: refs/heads/master@{#14821}
Patch Set 1 : Patch set for Chromium tryjobs #Patch Set 2 : Add root change for WebRTC trybots #Patch Set 3 : Rebased #Patch Set 4 : Restored some of webrtc and webrtc_tests, restricted visibility #Patch Set 5 : Readded lost dep: modules/video_capture:video_capture_internal_impl #Patch Set 6 : Fixed video_capture_tests #Patch Set 7 : Removing root BUILD.gn file for Chromium tryjobs again #Patch Set 8 : Restored root BUILD.gn for submit. #
Messages
Total messages: 26 (16 generated)
|