aboutsummaryrefslogtreecommitdiff
path: root/libbutl/buildfile
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-06 22:20:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-27 17:08:05 +0300
commit1c6758009e82c47b5b341d418be2be401ef31482 (patch)
treed3ef8c053280477086f6230e3d25ff90b25871a2 /libbutl/buildfile
parent070871d97b4f6440c3f0fc647ece73b53a5837db (diff)
Add builtins support
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.
#