Yes, it’s possible! With a single key press you can build and have a nice list of errors in the Error List window, clickable to get to the bad source code location easily. It was a fight, but here it is. Tested with Visual Studio Express 2013 for Windows Desktop, but I believe this all can be adapted to any version of the IDE.
Now when you make a modification to a C/C++ file just build the ‘mozilla-central’ project to run the great build binaries mach feature and quickly build the changes right from the IDE. Compilation and link errors as well as warnings will be nicely caught in the Error List.
BE AWARE: There is one problem – when there is a typo/mistake in an exported header file, it’s opened as a new file in the IDE from _obj/dist/include location. When you miss that and modify that file it will overwrite on next build! Using CreateHardLink might deal with this issue.
With these scripts you can use the Visual Studio 2013 IDE but build with any other version of VC++ of your choice. It’s independent, just run the start-up script from different VS configuration mozilla-build prompt.
I personally also create projects for modules (like /netwerk, /docshell, /dom) I often use. Just create a Makefile project located at the source root directory with name of the module directory. The project file will then be located in the module – I know, not really what one would expect. Switch Solution Explorer for that project to show all files, include them all in the project, and you are done.
Few other tweaks:
- Assuming you properly use an object dir, change the Output Directory and Intermediate Directory to point e.g. to
$(SolutionDir)\<your obj dir>\$(Configuration)\. The logging and other crap won’t then be created in your source repository.
to your custom hg ingnore file to prevent the Visual Studio project and solution files interfere with Mercurial. Same suggested for git, if you prefer it.
Note: you cannot use this for a clobbered build because of an undisclosed Python Windows-specific bug. See here why. Do clobbered builds from a console, or you may experiment with clobber + configure from a console and then build from the IDE.