Add option to change preprocessor -CC to -C

See #37.
This commit is contained in:
Jonathan Müller 2018-03-19 21:55:06 +01:00
commit 61a2a22542
4 changed files with 35 additions and 4 deletions

View file

@ -210,7 +210,8 @@ int main(int argc, char* argv[]) try
("gnu_extensions", "enable GNU extensions (equivalent to -std=gnu++XX)")
("msvc_extensions", "enable MSVC extensions (equivalent to -fms-extensions)")
("msvc_compatibility", "enable MSVC compatibility (equivalent to -fms-compatibility)")
("fast_preprocessing", "enable fast preprocessing, be careful, this breaks if you e.g. redefine macros in the same file!");
("fast_preprocessing", "enable fast preprocessing, be careful, this breaks if you e.g. redefine macros in the same file!")
("remove_comments_in_macro", "whether or not comments generated by macro are kept, enable if you run into errors");
// clang-format on
options.parse_positional("file");
options.parse(argc, argv);
@ -252,6 +253,9 @@ int main(int argc, char* argv[]) try
if (options.count("fast_preprocessing"))
config.fast_preprocessing(true);
if (options.count("remove_comments_in_macro"))
config.remove_comments_in_macro(true);
if (options.count("include_directory"))
for (auto& include : options["include_directory"].as<std::vector<std::string>>())
config.add_include_dir(include);