How to suppress D9025 warning in Microsoft C++ build tools
c++, msbuild, suppress-warnings, visual-studio
Solution
You cannot suppress D9025, you have to fix that. Command-line warning D9025 means you have conflicting options on cl.exe command line. In your case you have something like this:
cl ... /GL ... /GL- ...
Compiler actually uses the option that is specified last on the command line, but that command line is very confusing.
In your .vcxproj file make sure you have set correct option for WholeProgramOptimization property. Your configuration section might look like this:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
...
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
Problem
I am compiling a library with Microsoft C++ compiler and build tools. My build environment sets the compile flag /GL, but for a specific library I need to turn that flag off. I can do so with /GL-, but I get a warning D9025, which simply tells me I am overriding the previous setting. I want to suppress this warning. But the command line option /wd only forks for Cxxx errors and warnings, not Dxxx warnings. How do I suppress the D9025 warning?