Skip to content

Windows-MSVC: Fixes usage of '-' instead of '/' as switch character

Fixes a (supposed) parsing error by CLion/clangd which marks newer C++ features like std::filesystem as unknown when setting the property MSVC_RUNTIME_LIBRARY to MultiThreaded and selecting the Release config.

On top of fixing this issue, this commit also aligns the switch character of this specific argument with the one used by others arguments.

Example generated command before:

C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD -std:c++latest /showIncludes /FoCMakeFiles\Test2.dir\main.cpp.obj /FdCMakeFiles\Test2.dir\ /FS -c ..\main.cpp

and after:

C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG /MD -std:c++latest /showIncludes /FoCMakeFiles\Test2.dir\main.cpp.obj /FdCMakeFiles\Test2.dir\ /FS -c ..\main.cpp

Note the -MD which is replaced by /MD.

Merge request reports