When building a visual studio project or solution, how can I get the actual call to cl.exe
that is executed? For instance, I would like to see something like
cl.exe /c /I"C:\Path\to\Include" /Fo"Release\main.obj" /EHsc main.cpp
I would like to know the exact arguments that are passed to cl.exe
but I cannot see it in the output window, regardless of the verbosity.
I couldn't replicate the issue in Visual Studio 2022 with MSVC v143.
In Visual Studio 2022 I created a new C++ console app project via the template.
Steps to follow:
ClCompile
is the name of a target in the MSBuild.)I have the following output where the first line for Target ClCompile
is the compiler command line:
1>Target ClCompile:
1> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\CL.exe /c /ZI /JMC /nologo /W3 /WX- /diagnostics:column /sdl /Od /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /permissive- /Fo"CppConso.d37a0e87\x64\Debug\\" /Fd"CppConso.d37a0e87\x64\Debug\vc143.pdb" /external:W3 /Gd /TP /FC /errorReport:prompt CppConsoleApplication1.cpp
1> CppConsoleApplication1.cpp