diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-06-20 13:13:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-06-20 13:13:12 +0200 |
commit | ce1681f2524e512f461a446ee5ca86adfe9116df (patch) | |
tree | f1fa78fd494a44dd7836cac4ea696e5601d7a4de /cli/generator.cxx | |
parent | c5db2b9db6c8c707c745c5920a4179e6e6b2772c (diff) |
Support suppressing CLI runtime generation (--suppress-cli)
This is useful in pure-help pages.
Diffstat (limited to 'cli/generator.cxx')
-rw-r--r-- | cli/generator.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/cli/generator.cxx b/cli/generator.cxx index 01f77d5..3a0a55b 100644 --- a/cli/generator.cxx +++ b/cli/generator.cxx @@ -204,13 +204,20 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) // have to include in the generated header file, we will still // need to generate some template code in the source file. // - bool runtime (true); - for (semantics::cli_unit::includes_iterator i (unit.includes_begin ()); - runtime && i != unit.includes_end (); - ++i) + bool runtime (!ops.suppress_cli ()); + + if (runtime) { - if (i->is_a<semantics::cli_includes> ()) - runtime = false; + for (semantics::cli_unit::includes_iterator i (unit.includes_begin ()); + i != unit.includes_end (); + ++i) + { + if (i->is_a<semantics::cli_includes> ()) + { + runtime = false; + break; + } + } } // @@ -391,7 +398,8 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) if (runtime && !inl) generate_runtime_inline (ctx); - generate_runtime_source (ctx, runtime); + if (!ops.suppress_cli ()) + generate_runtime_source (ctx, runtime); if (!inl) generate_inline (ctx); |