aboutsummaryrefslogtreecommitdiff
path: root/libbutl/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/buildfile')
-rw-r--r--libbutl/buildfile40
1 files changed, 38 insertions, 2 deletions
diff --git a/libbutl/buildfile b/libbutl/buildfile
index a0b789a..e6841ab 100644
--- a/libbutl/buildfile
+++ b/libbutl/buildfile
@@ -13,8 +13,11 @@
#
# @@ If/when going back to using mxx{}, make sure to cleanup explicit .mxx.
#
-lib{butl}: {hxx ixx txx cxx}{** -uuid-* +uuid-io -win32-utility -version} \
- hxx{**.mxx} {hxx}{version}
+lib{butl}: {hxx ixx txx cxx}{** -uuid-* +uuid-io \
+ -win32-utility \
+ -version \
+ -builtin-options} \
+ hxx{**.mxx} {hxx}{version} {hxx ixx cxx}{builtin-options}
tclass = $cxx.target.class
tsys = $cxx.target.system
@@ -93,6 +96,39 @@ if $version.pre_release
else
lib{butl}: bin.lib.version = @"-$version.major.$version.minor"
+# Generated options parser.
+#
+if $cli.configured
+{
+ cli.cxx{builtin-options}: cli{builtin}
+
+ cli.options += --std c++11 -I $src_root --include-with-brackets \
+--include-prefix libbutl --guard-prefix LIBBUTL --cli-namespace butl::cli \
+--generate-vector-scanner --generate-parse --keep-separator \
+--generate-specifier --suppress-usage
+
+ cli.cxx{*}:
+ {
+ # Include the generated cli files into the distribution and don't remove
+ # them when cleaning in src (so that clean results in a state identical to
+ # distributed). But don't install their headers since they are only used
+ # internally in the builtins implementation.
+ #
+ dist = true
+ clean = ($src_root != $out_root)
+ install = false
+
+ # We keep the generated code in the repository so copy it back to src in
+ # case of a forwarded configuration.
+ #
+ backlink = overwrite
+ }
+}
+else
+ # No install for the pre-generated case.
+ #
+ hxx{builtin-options}@./ ixx{builtin-options}@./: install = false
+
# Install into the libbutl/ subdirectory of, say, /usr/include/
# recreating subdirectories.
#