From 1c6758009e82c47b5b341d418be2be401ef31482 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 6 Sep 2019 22:20:46 +0300 Subject: Add builtins support --- libbutl/buildfile | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'libbutl/buildfile') 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. # -- cgit v1.1