aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-03 11:21:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-03 11:21:23 +0200
commit8f3b0f246388db093c2719990e6503c9718e88ef (patch)
treef94991a63c79b0fb7a01f45afe7a375aabcb3e4b
parent4cc799f320f52e436afa62aff19ecfc4f1089145 (diff)
Make use of cli module optional
-rw-r--r--bpkg/buildfile13
1 files changed, 7 insertions, 6 deletions
diff --git a/bpkg/buildfile b/bpkg/buildfile
index d35cc22..ca32b64 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -50,12 +50,13 @@ $libs
# source files instead of using the cli.cxx{} group (it won't be there
# unless the module is loaded).
#
-# @@ TODO: make it optional.
-# @@ The cli{} target won't be available while it would be nice to
-# detect that .cli file is newer than the generated files. Hack:
-# use ctt= cli.used ? cli : file, then $ctt{common-options}. Uh.
-#
-using cli
+using? cli
+
+if! $cli.loaded
+{
+ define cli: file
+ cli{*}: extension = cli
+}
{hxx ixx cxx}{common-options}: cli{common-options}
{hxx ixx cxx}{configuration-options}: cli{configuration-options}