From 46f5d01e4f61cfba9e0f4bc7ecc59891c53ca8ec Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 30 Jan 2016 12:28:33 +0200 Subject: Add option documentation, reorganize things --- build2/buildfile | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'build2/buildfile') diff --git a/build2/buildfile b/build2/buildfile index 6fd0cac..412b348 100644 --- a/build2/buildfile +++ b/build2/buildfile @@ -7,6 +7,7 @@ import libs = libbutl%lib{butl} exe{b}: \ {hxx ixx txx cxx}{ algorithm } \ { cxx}{ b } \ + {hxx ixx cxx}{ b-options } \ {hxx txx cxx}{ context } \ {hxx cxx}{ diagnostics } \ {hxx cxx}{ dump } \ @@ -15,7 +16,6 @@ exe{b}: \ {hxx cxx}{ module } \ {hxx cxx}{ name } \ {hxx cxx}{ operation } \ - {hxx ixx cxx}{ options } \ {hxx cxx}{ parser } \ {hxx cxx}{ path-io } \ {hxx cxx}{ prerequisite } \ @@ -59,6 +59,33 @@ install/{hxx }{ utility } \ test/{hxx cxx}{ rule } \ $libs -#@@ TODO, also remove gen files from the repository/add to .gitignore +# Load the cli module but only if it's available. This way a distribution +# that includes pre-generated files can be built without installing cli. +# This is also the reason why above we explicitly spelled out individual +# source files instead of using the cli.cxx{} group (it won't be there +# unless the module is loaded). # -# cli --generate-specifier --cli-namespace cl --include-with-brackets --include-prefix build2 --guard-prefix BUILD2 --hxx-suffix "" options.cli +using? cli + +if! $cli.loaded +{ + define cli: file + cli{*}: extension = cli +} + +{hxx ixx cxx}{b-options}: cli{b} + +cli.options += -I $src_root --include-with-brackets --include-prefix build2 \ +--guard-prefix BUILD2 --cli-namespace build2::cl --generate-file-scanner \ +--generate-specifier + +# Usage options. +# +cli.options += --suppress-undocumented --long-usage --ansi-color \ +--page-usage 'build2::print_$name$_' --option-length 23 + +# Include generated cli files into the distribution. +# +hxx{*-options}: dist = true +ixx{*-options}: dist = true +cxx{*-options}: dist = true -- cgit v1.1