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

Unified Diff: build/config/BUILDCONFIG.gn

Issue 1548473003: GN Don't enable linker version script for components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | content/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/BUILDCONFIG.gn
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 54bf3722fa5c5c1197e790834d0154279a804dee..81323aa08f3709c9b1d079533bdc9a58c1d1ecc0 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -549,6 +549,9 @@ set_defaults("loadable_module") {
if (is_component_build) {
set_defaults("component") {
configs = _shared_library_configs
+ if (is_android) {
+ configs -= [ "//build/config/android:hide_native_jni_exports" ]
+ }
}
}
@@ -575,12 +578,25 @@ set_defaults("test") {
# COMPONENT SETUP
# ==============================================================================
-if (is_component_build) {
- _component_mode = "shared_library"
-} else {
- _component_mode = "source_set"
-}
+# Defines a component, which equates to a shared_library when
+# is_component_build == true and a source_set / static_library otherwise.
+#
+# Arguments are the same as a normal library with this addition:
+# component_never_use_source_set: Whether to use static_library instead of
+# source_set for non-component builds. Some targets (e.g. //base) should
+# use static_library rather than source_set to avoid linking unused object
+# files.
template("component") {
+ _never_use_source_set = defined(invoker.component_never_use_source_set) &&
+ invoker.component_never_use_source_set
+ assert(_never_use_source_set || true) # Mark as used.
+ if (is_component_build) {
+ _component_mode = "shared_library"
+ } else if (_never_use_source_set) {
+ _component_mode = "static_library"
+ } else {
+ _component_mode = "source_set"
+ }
target(_component_mode, target_name) {
forward_variables_from(invoker, "*")
« no previous file with comments | « base/BUILD.gn ('k') | content/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698