aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-28 16:21:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-28 16:21:03 +0200
commit28dcef63d86dc5a86919c45facddbf4e70d7b3bf (patch)
treec1b396d066b84d02d318d948a8f0254aaf8cce1a
parent995585489750512a28f84b028b3eea30c3a9c075 (diff)
Cleanup buildfiles some more
-rw-r--r--build2/buildfile33
-rw-r--r--libbuild2/buildfile8
2 files changed, 10 insertions, 31 deletions
diff --git a/build2/buildfile b/build2/buildfile
index fd9cec6..b8f7f95 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -13,29 +13,7 @@ for m: bash bin c cc cxx in version
libs += ../libbuild2/$m/lib{build2-$m}
}
-./: exe{b}: {hxx ixx txx cxx}{+b} libue{b}
-
-libue{b}: {hxx ixx txx cxx}{** -b -b-options -**.test...} \
- {hxx ixx cxx}{b-options} \
- $libs
-
-# Unit tests.
-#
-exe{*.test}:
-{
- test = true
- install = false
-}
-
-for t: cxx{**.test...}
-{
- d = $directory($t)
- n = $name($t)...
- b = $path.base($name($t))
-
- ./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n +$b+*.test...}
- $d/exe{$n}: libue{b}: bin.whole = false
-}
+exe{b}: {hxx ixx txx cxx}{** -b-options} {hxx ixx cxx}{b-options} $libs
# Build options.
#
@@ -56,8 +34,6 @@ if ($cxx.target.class != 'windows')
#
cxx.loptions += -Wl,--disable-new-dtags
}
-
- cxx.libs += -lpthread
}
else
{
@@ -68,10 +44,9 @@ else
else
stack_size = 4194304 # 4M
- if ($cxx.class == 'msvc')
- cxx.loptions += "/STACK:$stack_size"
- else
- cxx.loptions += "-Wl,--stack,$stack_size"
+ cxx.loptions += ($cxx.class == 'msvc' \
+ ? "/STACK:$stack_size" \
+ : "-Wl,--stack,$stack_size")
}
# Generated options parser.
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index feabdab..c419dd1 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -70,6 +70,10 @@ for t: cxx{ *.test...} \
# Build options.
#
+# NOTE: this scope happens to be outer to the bundled modules which means they
+# will inherit any scope-wide options. So we should normally only set
+# them on targets.
+#
obja{*}: cxx.poptions += -DLIBBUILD2_STATIC_BUILD
objs{*}: cxx.poptions += -DLIBBUILD2_SHARED_BUILD
@@ -92,10 +96,10 @@ if! $cross
if ($cxx.target.class != 'windows')
{
- cxx.libs += -lpthread
+ libul{build2}: cxx.libs += -lpthread
if ($cxx.target.class != "bsd")
- cxx.libs += -ldl
+ libul{build2}: cxx.libs += -ldl
}
# Export options.