diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-05-02 16:42:09 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-13 11:39:17 (GMT) |
commit | eb53141fda9023afe81a43dd969e2a25d906ac32 (patch) | |
tree | 16802ae4c2f08c08b4e91ec7a2208528fafecc27 | |
parent | 9bdc1be1b6b0c1b2ea522594ba8aeab9f69a3fce (diff) | |
download | Qt-eb53141fda9023afe81a43dd969e2a25d906ac32.zip Qt-eb53141fda9023afe81a43dd969e2a25d906ac32.tar.gz Qt-eb53141fda9023afe81a43dd969e2a25d906ac32.tar.bz2 |
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>
(cherry picked from commit 3c62f4d0c65f1a60bd8d4e6b985d79cb0aa8342b)
-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 |