Commit 1fd5cd4d authored by Nikolai Kosjar's avatar Nikolai Kosjar

Clang: Use compiler specific undefine option

libclang generated:

    warning: /U__cpp_aggregate_nsdmi: 'linker' input unused [-Wunused-command-line-argument]
    warning: /U__cpp_alias_templates: 'linker' input unused [-Wunused-command-line-argument]
    ...

It needs -U.

Change-Id: Ibbd2f97e6f806215e3008803f57608b9b6b4c641
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 4fbdbdb1
......@@ -263,6 +263,13 @@ private:
return CompilerOptionsBuilder::defineOption();
}
QString undefineOption() const override
{
if (m_isMsvcToolchain)
return QLatin1String("/U");
return CompilerOptionsBuilder::undefineOption();
}
void enableExceptions() override
{
if (m_isMsvcToolchain)
......
......@@ -342,7 +342,7 @@ void CompilerOptionsBuilder::undefineCppLanguageFeatureMacrosForMsvc2015()
// Undefine the language feature macros that are pre-defined in clang-cl 3.8.0,
// but not in MSVC2015's cl.exe.
foreach (const QString &macroName, languageFeatureMacros())
m_options.append(QLatin1String("/U") + macroName);
m_options.append(undefineOption() + macroName);
}
}
......@@ -364,6 +364,11 @@ QString CompilerOptionsBuilder::defineOption() const
return QLatin1String("-D");
}
QString CompilerOptionsBuilder::undefineOption() const
{
return QLatin1String("-U");
}
static bool isGccOrMinGwToolchain(const Core::Id &toolchainType)
{
return toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
......
......@@ -60,6 +60,7 @@ protected:
virtual bool excludeHeaderPath(const QString &headerPath) const;
virtual QString defineOption() const;
virtual QString undefineOption() const;
virtual QString includeOption() const;
const ProjectPart m_projectPart;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment