aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-28 16:22:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-28 16:30:31 +0200
commit6efd6dc40d46f1fa2028a4259c8b2b56f866d6f7 (patch)
treeb944fb9be6ccef52d66ce796dc4ae9da7d4f1185 /libbuild2
parent28dcef63d86dc5a86919c45facddbf4e70d7b3bf (diff)
Make lib{build2} "implied interface dependency" of modules
This makes our compilation and linking command lines a little bit saner.
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/bash/buildfile8
-rw-r--r--libbuild2/bin/buildfile12
-rw-r--r--libbuild2/buildfile7
-rw-r--r--libbuild2/c/buildfile8
-rw-r--r--libbuild2/cc/buildfile11
-rw-r--r--libbuild2/cxx/buildfile8
-rw-r--r--libbuild2/in/buildfile12
-rw-r--r--libbuild2/version/buildfile8
8 files changed, 30 insertions, 44 deletions
diff --git a/libbuild2/bash/buildfile b/libbuild2/bash/buildfile
index e30f379..c2fe242 100644
--- a/libbuild2/bash/buildfile
+++ b/libbuild2/bash/buildfile
@@ -2,16 +2,14 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
include ../in/
-int_libs += ../in/lib{build2-in}
+int_libs = ../in/lib{build2-in}
./: lib{build2-bash}: libul{build2-bash}: {hxx ixx txx cxx}{** -**.test...} \
- $int_libs
+ $int_libs $imp_libs
# Unit tests.
#
diff --git a/libbuild2/bin/buildfile b/libbuild2/bin/buildfile
index e490214..d5c6e83 100644
--- a/libbuild2/bin/buildfile
+++ b/libbuild2/bin/buildfile
@@ -2,13 +2,11 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
./: lib{build2-bin}: libul{build2-bin}: {hxx ixx txx cxx}{** -**.test...} \
- $int_libs
+ $imp_libs
# Unit tests.
#
@@ -34,11 +32,7 @@ objs{*}: cxx.poptions += -DLIBBUILD2_BIN_SHARED_BUILD
# Export options.
#
-lib{build2-bin}:
-{
- cxx.export.poptions = "-I$out_root" "-I$src_root"
- cxx.export.libs = $int_libs
-}
+lib{build2-bin}: cxx.export.poptions = "-I$out_root" "-I$src_root"
liba{build2-bin}: cxx.export.poptions += -DLIBBUILD2_BIN_STATIC
libs{build2-bin}: cxx.export.poptions += -DLIBBUILD2_BIN_SHARED
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index c419dd1..e838e8e 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -7,6 +7,13 @@
#
./: lib{build2} bash/ bin/ c/ cc/ cxx/ in/ version/
+# A module should treat lib{build2} as an "implied interface dependency"
+# meaning that it can link it as an implementation dependency and assume that
+# whomever imports and links this module will also import and link lib{build2}
+# explicitly. A module should also assume that lib{butl} will always be an
+# interface dependency of lib{build2} and therefore need not be explicitly
+# imported or linked.
+#
import int_libs = libbutl%lib{butl}
lib{build2}: libul{build2}: \
diff --git a/libbuild2/c/buildfile b/libbuild2/c/buildfile
index 234a0d7..63bdbcc 100644
--- a/libbuild2/c/buildfile
+++ b/libbuild2/c/buildfile
@@ -2,16 +2,14 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
include ../cc/
-int_libs += ../cc/lib{build2-cc}
+int_libs = ../cc/lib{build2-cc}
./: lib{build2-c}: libul{build2-c}: {hxx ixx txx cxx}{** -**.test...} \
- $int_libs
+ $int_libs $imp_libs
# Unit tests.
#
diff --git a/libbuild2/cc/buildfile b/libbuild2/cc/buildfile
index 5b3d8eb..50192fa 100644
--- a/libbuild2/cc/buildfile
+++ b/libbuild2/cc/buildfile
@@ -2,17 +2,16 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-import imp_libs = libpkgconf%lib{pkgconf}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
+
+import imp_libs += libpkgconf%lib{pkgconf}
include ../bin/
-int_libs += ../bin/lib{build2-bin}
+int_libs = ../bin/lib{build2-bin}
./: lib{build2-cc}: libul{build2-cc}: {hxx ixx txx cxx}{** -**.test...} \
- $imp_libs $int_libs
+ $int_libs $imp_libs
# Unit tests.
#
diff --git a/libbuild2/cxx/buildfile b/libbuild2/cxx/buildfile
index f7bd126..475c28f 100644
--- a/libbuild2/cxx/buildfile
+++ b/libbuild2/cxx/buildfile
@@ -2,16 +2,14 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
include ../cc/
-int_libs += ../cc/lib{build2-cc}
+int_libs = ../cc/lib{build2-cc}
./: lib{build2-cxx}: libul{build2-cxx}: {hxx ixx txx cxx}{** -**.test...} \
- $int_libs
+ $int_libs $imp_libs
# Unit tests.
#
diff --git a/libbuild2/in/buildfile b/libbuild2/in/buildfile
index b67ee00..a07e131 100644
--- a/libbuild2/in/buildfile
+++ b/libbuild2/in/buildfile
@@ -2,13 +2,11 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
./: lib{build2-in}: libul{build2-in}: {hxx ixx txx cxx}{** -**.test...} \
- $int_libs
+ $imp_libs
# Unit tests.
#
@@ -34,11 +32,7 @@ objs{*}: cxx.poptions += -DLIBBUILD2_IN_SHARED_BUILD
# Export options.
#
-lib{build2-in}:
-{
- cxx.export.poptions = "-I$out_root" "-I$src_root"
- cxx.export.libs = $int_libs
-}
+lib{build2-in}: cxx.export.poptions = "-I$out_root" "-I$src_root"
liba{build2-in}: cxx.export.poptions += -DLIBBUILD2_IN_STATIC
libs{build2-in}: cxx.export.poptions += -DLIBBUILD2_IN_SHARED
diff --git a/libbuild2/version/buildfile b/libbuild2/version/buildfile
index 96f55ad..ee65c4a 100644
--- a/libbuild2/version/buildfile
+++ b/libbuild2/version/buildfile
@@ -2,17 +2,15 @@
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-import int_libs = libbutl%lib{butl}
-
include ../
-int_libs += ../lib{build2}
+imp_libs = ../lib{build2} # Implied interface dependency.
include ../in/
-int_libs += ../in/lib{build2-in}
+int_libs = ../in/lib{build2-in}
./: lib{build2-version}: libul{build2-version}: \
{hxx ixx txx cxx}{** -**.test...} \
- $int_libs
+ $int_libs $imp_libs
# Unit tests.
#