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.





Create a shell script, you will (have to) use it every time to start Visual Studio from mozilla-build’s bash prompt: export MOZ__INCLUDE=$INCLUDE

export MOZ__LIB=$LIB

export MOZ__LIBPATH=$LIBPATH

export MOZ__PATH=$PATH

export MOZ__VSINSTALLDIR=$VSINSTALLDIR

# This is for standard installation of Visual Studio 2013 Desktop, alter the paths to your desired/installed IDE version

cd "/c/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/"

./WDExpress.exe & Create a solution ‘mozilla-central’ located at the parent directory where your mozilla-central repository clone resides. Say you have a structure like C:\Mozilla\mozilla-central , which is the root source folder where you find .hg , configure.in and all the modules’ sub-dirs. Then C:\Mozilla\ is the parent directory. In that solution, create a Makefile project ‘mozilla-central’, again located at the parent directory. It will, a bit unexpectedly, be created where you probably want it – in C:\Mozilla\mozilla-central . Let the Build Command Line for this project be (use the multi-line editor to copy & paste: combo-like arrow on the right, then the <Edit…> command): call " $(MOZ__ VSINSTALLDIR )\ VC\bin\vcvars32.bat"

set INCLUDE=$(MOZ__INCLUDE)

set LIB=$(MOZ__LIB)

set LIBPATH=$(MOZ__LIBPATH)

set PATH=$(MOZ__PATH)

set MOZCONFIG=c:\optional\path\to\your\custom\mozconfig

cd $(SolutionDir)

python mach --log-no-times build binaries



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.

. The logging and other crap won’t then be created in your source repository. Add:

^.*\.vcproj.*

^.*\.vcxproj.*

.sln$

.suo$

.ncb$

.sdf$

.opensdf$

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.