aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/buildfile
diff options
context:
space:
mode:
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