aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-28 13:46:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-28 13:46:26 +0200
commit1c7cbb302b1c6e41eb0c5cecfc655532f1919cba (patch)
tree84375e8be2bfe00b2387f02cab8dcca396019299 /build2/bin
parent24402ed431c1780914576f72350f8796308cb59b (diff)
Implement support for linking whole archive
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/init.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx
index fb9dd71..e145a23 100644
--- a/build2/bin/init.cxx
+++ b/build2/bin/init.cxx
@@ -76,6 +76,24 @@ namespace build2
vp.insert<strings> ("bin.libs.lib");
vp.insert<dir_paths> ("bin.rpath");
+ // Link whole archive. Note: non-overridable with target visibility.
+ //
+ // The lookup semantics is as follows: we first look for a prerequisite-
+ // specific value, then for a target-specific value in the library being
+ // linked, and then for target type/pattern-specific value starting from
+ // the scope of the target being linked-to. In that final lookup we do
+ // not look in the target being linked-to itself since that is used to
+ // indicate how this target should be linked to other targets. For
+ // example:
+ //
+ // exe{test}: liba{foo}
+ // liba{foo}: libu{foo1 foo2}
+ // liba{foo}: bin.whole = false # Affects test but not foo1 and foo2.
+ //
+ // If unspecified, defaults to false for liba{} and to true for libux{}.
+ //
+ vp.insert<bool> ("bin.whole", false, variable_visibility::target);
+
vp.insert<string> ("bin.lib.prefix");
vp.insert<string> ("bin.lib.suffix");
vp.insert<string> ("bin.exe.prefix");