VC 16.10/11 + CMake gives excessive warnings regarding /external:w0 switch.
Build the attach example with either VS 16.10 or 16.11 preview and generate an msbuild based solution.
build it with:
f:\projects\cmakeexttest\build>f:\tools\cmake\bin\cmake --build .
Microsoft (R) Build Engine version 16.11.0-preview-21263-03+e646b828f for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule F:/projects/cmakeexttest/CMakeLists.txt
cl : command line warning D9025: overriding '/external:W1' with '/external:W0' [F:\projects\cmakeexttest\build\testapp.
vcxproj]
Program.cpp
testapp.vcxproj -> F:\projects\cmakeexttest\build\Debug\testapp.exe
Building Custom Rule F:/projects/cmakeexttest/CMakeLists.txt
and the command line warning D9025: overriding '/external:W1' with '/external:W0'
warning pops up, problem is it does that once per file and for a project the size of blender that is A LOT of warnings.
the problem seems to stem from cmake not recognizing the switch and msbuild supplying it's own default value in the .vcxproj
file.
adding the following lines to share\cmake-3.20\Templates\MSBuild\FlagTables\v142_CL.json
seems to resolve the issue but i'm not familiar enough with cmake to determine if that is the appropriate location for such a fix.
{
"name": "ExternalWarningLevel",
"switch": "external:W0",
"comment": "TurnOffAllWarnings",
"value": "TurnOffAllWarnings",
"flags": []
},
{
"name": "ExternalWarningLevel",
"switch": "external:W1",
"comment": "Level1",
"value": "Level1",
"flags": []
},
{
"name": "ExternalWarningLevel",
"switch": "external:W2",
"comment": "Level2",
"value": "Level2",
"flags": []
},
{
"name": "ExternalWarningLevel",
"switch": "external:W3",
"comment": "Level3",
"value": "Level3",
"flags": []
},
{
"name": "ExternalWarningLevel",
"switch": "external:W4",
"comment": "Level4",
"value": "Level4",
"flags": []
},```
[extern_test.zip](/uploads/52dfe66df38bd0609461d40f7d52f72e/extern_test.zip)