diff options
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 33 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.h | 11 |
2 files changed, 30 insertions, 14 deletions
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 6f47be7..a8c936b 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -777,16 +777,14 @@ bool VCCLCompilerTool::parseOption(const char* option) found = false; break; case 'R': if(second == 'T' && third == 'C') { - if(fourth == '1') - BasicRuntimeChecks = runtimeBasicCheckAll; - else if(fourth == 'c') - SmallerTypeCheck = _True; - else if(fourth == 's') - BasicRuntimeChecks = runtimeCheckStackFrame; - else if(fourth == 'u') - BasicRuntimeChecks = runtimeCheckUninitVariables; - else - found = false; break; + int rtc = BasicRuntimeChecks; + for (size_t i = 4; option[i]; ++i) { + if (!parseRuntimeCheckOption(option[i], &rtc)) { + found = false; + break; + } + } + BasicRuntimeChecks = static_cast<basicRuntimeCheckOption>(rtc); } break; case 'T': @@ -1130,6 +1128,21 @@ bool VCCLCompilerTool::parseOption(const char* option) return true; } +bool VCCLCompilerTool::parseRuntimeCheckOption(char c, int *rtc) +{ + if (c == '1') + *rtc = runtimeBasicCheckAll; + else if (c == 'c') + SmallerTypeCheck = _True; + else if (c == 's') + *rtc |= runtimeCheckStackFrame; + else if (c == 'u') + *rtc |= runtimeCheckUninitVariables; + else + return false; + return true; +} + // VCLinkerTool ----------------------------------------------------- VCLinkerTool::VCLinkerTool() : DataExecutionPrevention(unset), diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 1176862..a5a0ba5 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -103,10 +103,10 @@ enum asmListingOption { asmListingAsmSrc }; enum basicRuntimeCheckOption { - runtimeBasicCheckNone, - runtimeCheckStackFrame, - runtimeCheckUninitVariables, - runtimeBasicCheckAll + runtimeBasicCheckNone = 0, + runtimeCheckStackFrame = 1, + runtimeCheckUninitVariables = 2, + runtimeBasicCheckAll = runtimeCheckStackFrame | runtimeCheckUninitVariables }; enum browseInfoOption { brInfoNone, @@ -576,6 +576,9 @@ public: QString PreprocessOutputPath; VCConfiguration* config; + +private: + bool parseRuntimeCheckOption(char c, int *rtc); }; class VCLinkerTool : public VCToolBase |