aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-05 13:16:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-05 13:16:21 +0200
commit55ddc71fd801e06115ad6e33098b0eed2517daab (patch)
treec68892733b899e39c2bdc49b0ffa73282c1644d4 /libbuild2/buildfile
parent4fe1c3c083acecf7eabe46b67cb540e8390f3122 (diff)
Add support for automatic importing of libbuild2 of installed case
Diffstat (limited to 'libbuild2/buildfile')
-rw-r--r--libbuild2/buildfile10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index 325d54a..545ccba 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -117,9 +117,19 @@ cross = ($cxx.target.cpu != $build.host.cpu || \
$cxx.target.system != $build.host.system)
if! $cross
+{
{obja objs}{context}: cxx.poptions += \
-DBUILD2_IMPORT_PATH=\"$regex.replace($out_root, '\\', '\\\\')\"
+ # While this object file should only be linked when we are installing, it
+ # will be compiled even in the uninstalled case.
+ #
+ if ($install.root != [null])
+ {obja objs}{utility-installed}: cxx.poptions += \
+ -DBUILD2_INSTALL_LIB=\"$regex.replace(\
+ $install.resolve($install.lib), '\\', '\\\\')\"
+}
+
if ($cxx.target.class != 'windows')
{
libul{build2}: cxx.libs += -lpthread