Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: docs/component_build.md

Issue 2686133003: Add a common mistake case for header-only classes in components build doc (Closed)
Patch Set: Use brettw wording Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # The Chrome Component Build 1 # The Chrome Component Build
2 2
3 ## Introduction 3 ## Introduction
4 4
5 Release builds are “static” builds which compile to one executable and 5 Release builds are “static” builds which compile to one executable and
6 zero-to-two shared libraries (depending on the platform). This is efficient at 6 zero-to-two shared libraries (depending on the platform). This is efficient at
7 runtime, but can take a long time to link because so much code goes into a 7 runtime, but can take a long time to link because so much code goes into a
8 single binary. 8 single binary.
9 9
10 In a component build, many smaller shared libraries will be generated. This 10 In a component build, many smaller shared libraries will be generated. This
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 cases above where `_IMPLEMENTATION` is inappropriately defined or inappropriatel y 246 cases above where `_IMPLEMENTATION` is inappropriately defined or inappropriatel y
247 undefined. Use GN visibility to make sure callers don’t screw up. 247 undefined. Use GN visibility to make sure callers don’t screw up.
248 248
249 ### Putting exported symbols in static libraries 249 ### Putting exported symbols in static libraries
250 250
251 As discussed above, exported symbols should not be in static libraries because 251 As discussed above, exported symbols should not be in static libraries because
252 the object file might not be brought into the link. Even if it is brought in 252 the object file might not be brought into the link. Even if it is brought in
253 today, it might not be brought in due to completely unrelated changes in the 253 today, it might not be brought in due to completely unrelated changes in the
254 future. The result will be undefined symbol errors from other components. Use 254 future. The result will be undefined symbol errors from other components. Use
255 source sets if your component is made up of more than one target. 255 source sets if your component is made up of more than one target.
256
257 ### Exporting functions and classes implemented in headers
258
259 When you implement a symbol in a header the compiler will put that in every
260 necessary translation unit and the linker will pick one. If the symbol is never
261 referenced by code in the shared library it's supposed exported from, it will
262 never be instantiated and never exported. The result will be undefined external
263 symbol errors when linking. Exported symbols should be declared in a header but
264 always implemented in a .cc file.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698