diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-05-02 18:42:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-07 15:02:49 +0200 |
commit | 3c62f4d0c65f1a60bd8d4e6b985d79cb0aa8342b (patch) | |
tree | 0a21d79af878e0376175b70e752a91d211773fde | |
parent | a3d1d41d1d88b989fe7c460ef32b4f8606aafe0c (diff) |
qmake/vcxproj: fix parsing of /RTC* options
/RTCsu and /RTCus must be handled as full runtime check options.
Task-number: QTBUG-30711
Change-Id: I783bf49f2ab1d4fd9636dca8e434bccb54844c8c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-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 60e3d7b6ed..99f69bfa72 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -779,16 +779,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': @@ -1138,6 +1136,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 54819cbe5b..d289afe366 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -106,10 +106,10 @@ enum asmListingOption { asmListingAsmSrc }; enum basicRuntimeCheckOption { - runtimeBasicCheckNone, - runtimeCheckStackFrame, - runtimeCheckUninitVariables, - runtimeBasicCheckAll + runtimeBasicCheckNone = 0, + runtimeCheckStackFrame = 1, + runtimeCheckUninitVariables = 2, + runtimeBasicCheckAll = runtimeCheckStackFrame | runtimeCheckUninitVariables }; enum browseInfoOption { brInfoNone, @@ -580,6 +580,9 @@ public: QString PreprocessOutputPath; VCConfiguration* config; + +private: + bool parseRuntimeCheckOption(char c, int *rtc); }; class VCLinkerTool : public VCToolBase |