Add command line option for feature flags
This commit is contained in:
parent
336a00946d
commit
4860bf6981
1 changed files with 5 additions and 0 deletions
|
|
@ -207,6 +207,8 @@ int main(int argc, char* argv[]) try
|
||||||
cxxopts::value<std::vector<std::string>>())
|
cxxopts::value<std::vector<std::string>>())
|
||||||
("U,macro_undefinition", "undefine a macro on the command line",
|
("U,macro_undefinition", "undefine a macro on the command line",
|
||||||
cxxopts::value<std::vector<std::string>>())
|
cxxopts::value<std::vector<std::string>>())
|
||||||
|
("f,feature", "enable a custom feature (-fXX flag)",
|
||||||
|
cxxopts::value<std::vector<std::string>>())
|
||||||
("gnu_extensions", "enable GNU extensions (equivalent to -std=gnu++XX)")
|
("gnu_extensions", "enable GNU extensions (equivalent to -std=gnu++XX)")
|
||||||
("msvc_extensions", "enable MSVC extensions (equivalent to -fms-extensions)")
|
("msvc_extensions", "enable MSVC extensions (equivalent to -fms-extensions)")
|
||||||
("msvc_compatibility", "enable MSVC compatibility (equivalent to -fms-compatibility)")
|
("msvc_compatibility", "enable MSVC compatibility (equivalent to -fms-compatibility)")
|
||||||
|
|
@ -275,6 +277,9 @@ int main(int argc, char* argv[]) try
|
||||||
if (options.count("macro_undefinition"))
|
if (options.count("macro_undefinition"))
|
||||||
for (auto& name : options["macro_undefinition"].as<std::vector<std::string>>())
|
for (auto& name : options["macro_undefinition"].as<std::vector<std::string>>())
|
||||||
config.undefine_macro(name);
|
config.undefine_macro(name);
|
||||||
|
if (options.count("feature"))
|
||||||
|
for (auto& name : options["feature"].as<std::vector<std::string>>())
|
||||||
|
config.enable_feature(name);
|
||||||
|
|
||||||
// the compile_flags are generic flags
|
// the compile_flags are generic flags
|
||||||
cppast::compile_flags flags;
|
cppast::compile_flags flags;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue