<div dir="ltr">Hi all,<div><br></div><div>I'm hoping someone can clarify some confusion I have regarding the flags used in Visual Studio Cmake builds.</div><div><br></div><div>For example, in a release build, there are the defaults:</div><div><br></div><div>CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc<br></div><div>CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG</div><div><br></div><div>We can obviously append to or modify these within our CMakeLists.txt files. However, my actual build flags look like this:</div><div><br></div><div>/nologo /W3 /WX- /O2 /Ob2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"PROJECT.DIR\RELEASE\\" /Fd"PROJECT.DIR\RELEASE\VC140.PDB" /Gd /TP /analyze-<br></div><div><br></div><div>Where are all these other flags coming from? Some of these I appreciate are necessary for the CMake mechanics to work, but what if (for whatever reason) I wanted to remove one of the other flags that isn't defined by CMAKE_CXX_FLAGS or CMAKE_CXX_FLAGS_RELEASE (e.g., /Zc:wchar_t)?</div><div><br></div><div>Can Cmake users override the values from the <a href="https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmVS141CLFlagTable.h">default flag table</a>?</div><div><br></div><div>Regards,</div><div><br></div><div>Neal Kruis</div></div>