diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-06-03 11:46:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-06-03 11:46:04 +0200 |
commit | 31f5102fa8694980891274006eb15b5bebdb28d6 (patch) | |
tree | c689b5a57f5bb505ce82aeda0796ca5d63d836ce /cli/generator.cxx | |
parent | 4c776f3cb590bf031d6288043c530679a207a0c0 (diff) |
Generate certain template runtime code in every source file
This is needed if the cli runtime is included from another file instead
of being generated. The alternative would be to move that code to the
header file. However, that would also require including a lot of standard
headers in the generated header file.
Diffstat (limited to 'cli/generator.cxx')
-rw-r--r-- | cli/generator.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cli/generator.cxx b/cli/generator.cxx index 8b4b244..1ebde25 100644 --- a/cli/generator.cxx +++ b/cli/generator.cxx @@ -160,7 +160,9 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) // Check if we need to generate the runtime code. If we include // another options file, then we assume the runtime is generated - // there. + // there. However, to reduce the number of standard headers we + // 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 ()); @@ -288,13 +290,10 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) (br ? '>' : '"') << endl << endl; - if (runtime) - { - if (!inl) - generate_runtime_inline (ctx); + if (runtime && !inl) + generate_runtime_inline (ctx); - generate_runtime_source (ctx); - } + generate_runtime_source (ctx, runtime); if (!inl) generate_inline (ctx); |