Skip to content

Commit

Permalink
Update component build documentation.
Browse files Browse the repository at this point in the history
This build was recently made the default, and more documentation was added. This brings everything in sync.

Review-Url: https://codereview.chromium.org/2210813002
Cr-Commit-Position: refs/heads/master@{#409863}
  • Loading branch information
brettw authored and Commit bot committed Aug 4, 2016
1 parent a44d109 commit 9fb6417
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ declare_args() {
# Component build. Setting to true compiles targets declared as "components"
# as shared libraries loaded dynamically. This speeds up development time.
# When false, components will be linked statically.
#
# For more information see
# https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md
is_component_build = is_debug && current_os != "ios"
}

Expand Down
16 changes: 10 additions & 6 deletions docs/component_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@
Release builds are “static” builds which compile to one executable and
zero-to-two shared libraries (depending on the platform). This is efficient at
runtime, but can take a long time to link because so much code goes into a
single binary. When you set the GN build variable
single binary.

In a component build, many smaller shared libraries will be generated. This
speeds up link times, and means that many changes only require that the local
shared library be linked rather than the full executable, but at the expense of
program load-time performance.

The component build is currently the default for debug non-iOS builds (it
doesn’t work for iOS). You can force it on for release builds using the
[GN build arg](https://www.chromium.org/developers/gn-build-configuration):

```python
is_component_build = true
```

the build will generate many smaller shared libraries. This speeds up link
times, and means that many changes only require that the local shared library
be linked rather than the full executable, but at the expense of program
load-time performance.

### How to make a component

Defining a component just means using the GN “component” template instead
Expand Down

0 comments on commit 9fb6417

Please sign in to comment.