Search code examples
c++cvisual-studiocompilation

Is there a way to find what build command visual studio is using internally?


I am compiling a program with visual studio and I need to figure out an equivalent cmd command so I can use Emscripten. I have tried to figure it out by pointing to the same libraries but it is not working. Is there a way to find what build command visual studio is using internally?

Output messages:

cl /c /IC:\Users\Drago\source\repos\OpenGL\Dependencies\GLFW\include /Zi /W3 /WX- /diagnostics:column /sdl /O2 /Oi /Oy- /GL /D WIN32 /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Release\\" /Fd"Release\vc142.pdb" /Gd /TP /analyze- /FC /errorReport:prompt src\Application.cpp

"/OUT:C:\Users\Drago\source\repos\OpenGL\Release\OpenGL.exe" /INCREMENTAL:NO "/LIBPATH:C:\Users\Drago\source\repos\OpenGL\Dependencies\GLFW\lib-vc2017" glfw3.lib opengl32.lib User32.lib Gdi32.lib Shell32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG "/PDB:C:\Users\Drago\source\repos\OpenGL\Release\OpenGL.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:incremental "/LTCGOUT:Release\OpenGL.iobj" /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:C:\Users\Drago\source\repos\OpenGL\Release\OpenGL.lib" /MACHINE:X86 /SAFESEH Release\Application.obj

Solution

  • In project properties for C/C++ / General. Locate "Suppress Startup Banner" and force it to No. (Equivalent to not specifying /nologo as a command line param)

    When the project builds, you'll see the command line arguments passed to cl.exe in the output window.

    You can achive the same effect with the linker showing the command line params. Just look for "Suppress Startup Banner" under Linker/General and set it to No as well to see the command line params passed to link.exe

    enter image description here