Here are some general notes to remind me how to setup cmder
with msvc
and ninja
to compile from the command line.
Things you will need:
Setting up environment for Windows
The key is to setup the environment on Windows, there is a script for this that comes with your Visual Studio install known as vcvarsall.bat
. You can add this to the startup options in cmder
as the below command.
cmd /k ""%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64 && "%ConEmuDir%\..\init.bat"" -new_console:d:%USERPROFILE%
As you can see above, there is an
x64
just after thevcvarsall.bat
, as you might have guessed this specifies 64-bit builds. Remove this for 32-bit builds!
Visual Studio 2017 has changed the directory and the naming scheme for the environment variables are slightly different. I’ve not worked out what they are yet but you can find
vcvarsall.bat
here"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall"
It’s as simple as that! Now hopefully I’ll never forget this and can refer to this post.
Using CMake and ninja going forward is as simple as specifying as the generator with -G
.
cmake -G Ninja ..