diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-24 15:41:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-24 15:41:54 +0200 |
commit | 3a8972b42f75e10e9a833bba58d65009e7bed7f3 (patch) | |
tree | cb350e533b967b828ece6a59ced5bb2caa932de7 /build2/utility.cxx | |
parent | feb55ebfdc536c32de2c173d108df5ee0004da44 (diff) |
Handle *.export.libs, distinguish interface and implementation dependencies
A library dependency on another libraries is either "interface" or
"implementation". If it is interface, then everyone who links to this library
should also link to the interface dependency, explicitly. A good example of
an interface dependency is a library API that is called in inline functions.
Interface dependencies of a library should be explicitly listed in the
*.export.libs (where we can also list target names). So the typical usage
will be along these lines:
import int_libs = libfoo%lib{foo}
import int_libs += ...
import imp_libs = libbar%lib{bar}
import imp_libs += ...
lib{baz}: ... $int_libs $imp_libs
lib{baz}: cxx.export.libs = $int_libs
Diffstat (limited to 'build2/utility.cxx')
-rw-r--r-- | build2/utility.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/build2/utility.cxx b/build2/utility.cxx index dc862c6..ef90084 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -173,6 +173,13 @@ namespace build2 } void + append_options (strings& args, const lookup& l) + { + if (l) + append_options (args, cast<strings> (l)); + } + + void hash_options (sha256& csum, const lookup& l) { if (l) @@ -192,6 +199,18 @@ namespace build2 } void + append_options (strings& args, const strings& sv) + { + if (!sv.empty ()) + { + args.reserve (args.size () + sv.size ()); + + for (const string& s: sv) + args.push_back (s); + } + } + + void hash_options (sha256& csum, const strings& sv) { for (const string& s: sv) |