forked from qt-creator/qt-creator
Clang: Use -fms-compatibility-version with clang-cl toolchain
It's used while building so let's also do that in Clang Code Model. Change-Id: I4e5e3ccc71d14c8d44049672e37380af2592390f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -472,13 +472,15 @@ static QByteArray msCompatibilityVersionFromDefines(const ProjectExplorer::Macro
|
||||
|
||||
void CompilerOptionsBuilder::addMsvcCompatibilityVersion()
|
||||
{
|
||||
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) {
|
||||
const ProjectExplorer::Macros macros = m_projectPart.toolChainMacros + m_projectPart.projectMacros;
|
||||
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID
|
||||
|| m_projectPart.toolchainType == ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID) {
|
||||
const ProjectExplorer::Macros macros = m_projectPart.toolChainMacros
|
||||
+ m_projectPart.projectMacros;
|
||||
const QByteArray msvcVersion = msCompatibilityVersionFromDefines(macros);
|
||||
|
||||
if (!msvcVersion.isEmpty()) {
|
||||
const QString option = QLatin1String("-fms-compatibility-version=")
|
||||
+ QLatin1String(msvcVersion);
|
||||
+ QLatin1String(msvcVersion);
|
||||
m_options.append(option);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user