Update WebRTC style guide about GN.
No-Try: True Bug: None Change-Id: Iaee25f35eba70d05c0bd2abd1a578db44414ede9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288363 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38907}
This commit is contained in:
parent
50454ef84a
commit
ab397ddec4
@ -222,15 +222,26 @@ guide.
|
|||||||
|
|
||||||
### <a name="webrtc-gn-templates"></a>WebRTC-specific GN templates
|
### <a name="webrtc-gn-templates"></a>WebRTC-specific GN templates
|
||||||
|
|
||||||
Use the following [GN templates][gn-templ] to ensure that all our
|
As shown in the table below, for library targets (`source_set` and
|
||||||
[GN targets][gn-target] are built with the same configuration:
|
`static_library`), you should default on using `rtc_library` (which abstracts
|
||||||
|
away the complexity of using the correct target type for Chromium component
|
||||||
|
builds).
|
||||||
|
|
||||||
|
The general rule is for library targets is:
|
||||||
|
1. Use `rtc_library`.
|
||||||
|
2. If the library is a header only target use `rtc_source_set`.
|
||||||
|
3. If you really need to generate a static library, use `rtc_static_library`
|
||||||
|
(same for shared libraries, in such case use `rtc_shared_library`).
|
||||||
|
|
||||||
|
To ensure that all our [GN targets][gn-target] are built with the same
|
||||||
|
configuration, only use the following [GN templates][gn-templ].
|
||||||
|
|
||||||
| instead of | use |
|
| instead of | use |
|
||||||
|------------------|----------------------|
|
|------------------|-----------------------------------------------------------------------------------------|
|
||||||
| `executable` | `rtc_executable` |
|
| `executable` | `rtc_executable` |
|
||||||
| `shared_library` | `rtc_shared_library` |
|
| `shared_library` | `rtc_shared_library` |
|
||||||
| `source_set` | `rtc_source_set` |
|
| `source_set` | `rtc_source_set` (only for header only libraries, for everything else use `rtc_library` |
|
||||||
| `static_library` | `rtc_static_library` |
|
| `static_library` | `rtc_static_library` (use `rtc_library` unless you really need `rtc_static_library` |
|
||||||
| `test` | `rtc_test` |
|
| `test` | `rtc_test` |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user