I’ve never really been been much into the various cross platform build tools like SCons or CMake, I just don’t maintain all that much cross platform code, so all the extra initial effort just hasn’t been worth it.
Well last night I found myself wanting to edit Godot’s source code, so let me just fire up Visual Studio and… ahhhh crap, no Visual Studio project! Hmmm, this is just annoying. I don’t mind building from the command line but I certainly mind giving up my IDE and more importantly Intellisense. So I resign with having to create my own Visual Studio solution (sln) file. This is always a somewhat annoying process as you’ve got to figure out all the various dependencies and recreate them.
Then I have a thought… hmmmm, I wonder if this functionality is built into SCons? I mean, CMake is essentially a build file builder ( it generates a project file for your required platform/compiler of choice ), perhaps this functionality is built into scons. Lo and behold, it is! If you are working on Windows with Visual Studio, simply fire up a Visual Studio command line so you have the proper environment variables set.
Then simply change to the directory you installed the Godot source ( or your other SCons built project, just locate the SConstruct file ) and type:
scons vsproj=yes platform=windows
… and voila.
The only downside is the NMake build commands don’t work. If you check your project you see:
These are the commands that are run when you choose Build/Rebuild and Clean, and basically each just call Scons. Oddly for me though they don’t seem to run in the proper environment ( VC isn’t found ) and I can’t specify the platform=windows required to run.
I’m at a bit of a loss however how I would actually debug the project, which is somewhat annoying…
EDIT:
Hmmm, this seems to set me up for editing which is cool, but I believe I lose access to the single best feature of Visual Studio… the debugger.