In Chrome we have component builds for developers to speed up build time by linking the executable as a bunch of smaller shared library targets. To support this we have a special "component" build target type which build as a static library when is_component_build = false but build as a shared library when is_component_build = true.[1]
Linking against shared libraries requires dealing with symbol imports and exports, and we use preprocessor macros to deal with this as painlessly as possible. The old way of doing things required writing a header specifically for your component target and annotating all your symbols with a macro defined in that header.[2]
The new way is to use the generic COMPONENT_EXPORT macro defined in base/component_export.h, parameterized with a token that is derived from your build target definition.[3] This is nice because it avoids the need for special headers scattered all over the tree just to support component builds.
There are still tons of targets around the tree using the old thing instead of the new thing. It would be nice to use the new thing for the //mojo/public/cpp/bindings:bindings target.
An example CL which does this for the //ipc:ipc target can be found here: https://chromium-review.googlesource.com/c/chromium/src/+/876884
[1] https://chromium.googlesource.com/chromium/src/+/HEAD/docs/component_build.md
[2] https://chromium.googlesource.com/chromium/src/+/HEAD/docs/component_build.md#chrome_s-deprecated-pattern-for-exports
[3] https://chromium.googlesource.com/chromium/src/+/HEAD/docs/component_build.md#exporting-and-importing-symbols
Comment 1 by rockot@google.com
, Dec 3Status: Assigned (was: Available)