From b143a4a1a028d3147b9b603e77866780b34ee828 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Mar 2010 11:05:46 +0200 Subject: Add code generator infrastructure --- odb/options.cxx | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 6 deletions(-) (limited to 'odb/options.cxx') diff --git a/odb/options.cxx b/odb/options.cxx index 8226e3f..b209119 100644 --- a/odb/options.cxx +++ b/odb/options.cxx @@ -490,6 +490,13 @@ options (int& argc, ::cli::unknown_mode arg) : help_ (), version_ (), + output_dir_ (), + odb_file_suffix_ ("-odb"), + hxx_suffix_ (".hxx"), + ixx_suffix_ (".ixx"), + cxx_suffix_ (".cxx"), + include_with_brackets_ (), + include_prefix_ (), trace_ (), options_file_ () { @@ -506,6 +513,13 @@ options (int start, ::cli::unknown_mode arg) : help_ (), version_ (), + output_dir_ (), + odb_file_suffix_ ("-odb"), + hxx_suffix_ (".hxx"), + ixx_suffix_ (".ixx"), + cxx_suffix_ (".cxx"), + include_with_brackets_ (), + include_prefix_ (), trace_ (), options_file_ () { @@ -522,6 +536,13 @@ options (int& argc, ::cli::unknown_mode arg) : help_ (), version_ (), + output_dir_ (), + odb_file_suffix_ ("-odb"), + hxx_suffix_ (".hxx"), + ixx_suffix_ (".ixx"), + cxx_suffix_ (".cxx"), + include_with_brackets_ (), + include_prefix_ (), trace_ (), options_file_ () { @@ -540,6 +561,13 @@ options (int start, ::cli::unknown_mode arg) : help_ (), version_ (), + output_dir_ (), + odb_file_suffix_ ("-odb"), + hxx_suffix_ (".hxx"), + ixx_suffix_ (".ixx"), + cxx_suffix_ (".cxx"), + include_with_brackets_ (), + include_prefix_ (), trace_ (), options_file_ () { @@ -554,6 +582,13 @@ options (::cli::scanner& s, ::cli::unknown_mode arg) : help_ (), version_ (), + output_dir_ (), + odb_file_suffix_ ("-odb"), + hxx_suffix_ (".hxx"), + ixx_suffix_ (".ixx"), + cxx_suffix_ (".cxx"), + include_with_brackets_ (), + include_prefix_ (), trace_ (), options_file_ () { @@ -563,15 +598,36 @@ options (::cli::scanner& s, void options:: print_usage (::std::ostream& os) { - os << "--help Print usage information and exit." << ::std::endl; + os << "--help Print usage information and exit." << ::std::endl; - os << "--version Print version and exit." << ::std::endl; + os << "--version Print version and exit." << ::std::endl; - os << "--trace Trace the compilation process." << ::std::endl; + os << "--output-dir|-o Write the generated files to instead of the" << ::std::endl + << " current directory." << ::std::endl; - os << "--options-file Read additional options from with each option" << ::std::endl - << " appearing on a separate line optionally followed by space" << ::std::endl - << " and an option value." << ::std::endl; + os << "--odb-file-suffix Use instead of the default '-odb' to" << ::std::endl + << " construct the names of the generated ODB files." << ::std::endl; + + os << "--hxx-suffix Use instead of the default '.hxx' to" << ::std::endl + << " construct the name of the generated header file." << ::std::endl; + + os << "--ixx-suffix Use instead of the default '.ixx' to" << ::std::endl + << " construct the name of the generated inline file." << ::std::endl; + + os << "--cxx-suffix Use instead of the default '.cxx' to" << ::std::endl + << " construct the name of the generated source file." << ::std::endl; + + os << "--include-with-brackets Use angle brackets (<>) instead of quotes (\"\") in the" << ::std::endl + << " generated '#include' directives." << ::std::endl; + + os << "--include-prefix Add to the generated '#include' directive" << ::std::endl + << " paths." << ::std::endl; + + os << "--trace Trace the compilation process." << ::std::endl; + + os << "--options-file Read additional options from with each option" << ::std::endl + << " appearing on a separate line optionally followed by" << ::std::endl + << " space and an option value." << ::std::endl; } typedef @@ -588,6 +644,22 @@ struct _cli_options_map_init &::cli::thunk< options, bool, &options::help_ >; _cli_options_map_["--version"] = &::cli::thunk< options, bool, &options::version_ >; + _cli_options_map_["--output-dir"] = + &::cli::thunk< options, std::string, &options::output_dir_ >; + _cli_options_map_["-o"] = + &::cli::thunk< options, std::string, &options::output_dir_ >; + _cli_options_map_["--odb-file-suffix"] = + &::cli::thunk< options, std::string, &options::odb_file_suffix_ >; + _cli_options_map_["--hxx-suffix"] = + &::cli::thunk< options, std::string, &options::hxx_suffix_ >; + _cli_options_map_["--ixx-suffix"] = + &::cli::thunk< options, std::string, &options::ixx_suffix_ >; + _cli_options_map_["--cxx-suffix"] = + &::cli::thunk< options, std::string, &options::cxx_suffix_ >; + _cli_options_map_["--include-with-brackets"] = + &::cli::thunk< options, bool, &options::include_with_brackets_ >; + _cli_options_map_["--include-prefix"] = + &::cli::thunk< options, std::string, &options::include_prefix_ >; _cli_options_map_["--trace"] = &::cli::thunk< options, bool, &options::trace_ >; _cli_options_map_["--options-file"] = -- cgit v1.1