diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-21 11:06:17 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-21 11:06:17 +0200 |
commit | 445fd7c1968112664b1fbbe6215ed76609cfb8ac (patch) | |
tree | c46fbb8eb191945dc9ff5da48d9288fe0b206436 /backend/ninja | |
parent | 0941a99aa4ac45ebe4bea4705e4cd24aec156bf5 (diff) |
Add lang.cpp.enable_exceptions option to enable/disable options, add c20, add c++03, c++98 and c++20
Diffstat (limited to 'backend/ninja')
-rw-r--r-- | backend/ninja/Ninja.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index f4beeb8..456eb27 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -122,6 +122,7 @@ namespace backend case CVersion::C89: return { ninja::NinjaArg("-std=c89"), ninja::NinjaArg("-pedantic") }; case CVersion::C99: return { ninja::NinjaArg("-std=c99"), ninja::NinjaArg("-pedantic") }; case CVersion::C11: return { ninja::NinjaArg("-std=c11"), ninja::NinjaArg("-pedantic") }; + case CVersion::C20: return { ninja::NinjaArg("-std=c20"), ninja::NinjaArg("-pedantic") }; } break; } @@ -147,9 +148,12 @@ namespace backend { switch(cppVersion) { + case CPPVersion::CPP03: return { ninja::NinjaArg("-std=c++03"), ninja::NinjaArg("-pedantic") }; + case CPPVersion::CPP98: return { ninja::NinjaArg("-std=c++98"), ninja::NinjaArg("-pedantic") }; case CPPVersion::CPP11: return { ninja::NinjaArg("-std=c++11"), ninja::NinjaArg("-pedantic") }; case CPPVersion::CPP14: return { ninja::NinjaArg("-std=c++14"), ninja::NinjaArg("-pedantic") }; case CPPVersion::CPP17: return { ninja::NinjaArg("-std=c++17"), ninja::NinjaArg("-pedantic") }; + case CPPVersion::CPP20: return { ninja::NinjaArg("-std=c++20"), ninja::NinjaArg("-pedantic") }; } break; } @@ -158,9 +162,12 @@ namespace backend switch(cppVersion) { // Use /Za flag? + case CPPVersion::CPP03: return { ninja::NinjaArg("/std:c++03") }; + case CPPVersion::CPP98: return { ninja::NinjaArg("/std:c++98") }; case CPPVersion::CPP11: return { ninja::NinjaArg("/std:c++11") }; case CPPVersion::CPP14: return { ninja::NinjaArg("/std:c++14") }; case CPPVersion::CPP17: return { ninja::NinjaArg("/std:c++17") }; + case CPPVersion::CPP20: return { ninja::NinjaArg("/std:c++20") }; } break; } @@ -1006,7 +1013,7 @@ namespace backend compileCppCommand = compileCCommand; compileCppCommand.insert(compileCppCommand.end(), { - ninja::NinjaArg("-fexceptions"), + ninja::NinjaArg(config.enableExceptions ? "-fexceptions" : "-fno-exceptions"), ninja::NinjaArg("-Wnon-virtual-dtor") }); |