diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-30 12:28:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-30 12:28:33 +0200 |
commit | 46f5d01e4f61cfba9e0f4bc7ecc59891c53ca8ec (patch) | |
tree | 9937800abbc5c50d0aa819d4956231262d7c1522 /build2/buildfile | |
parent | 9f0bac92ada2a83e3a438e3fef28a6ed867710de (diff) |
Add option documentation, reorganize things
Diffstat (limited to 'build2/buildfile')
-rw-r--r-- | build2/buildfile | 33 |
1 files changed, 30 insertions, 3 deletions
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 |