From 31f5102fa8694980891274006eb15b5bebdb28d6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 3 Jun 2012 11:46:04 +0200 Subject: 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. --- cli/generator.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'cli/generator.cxx') 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); -- cgit v1.1