User avatar
stunstall
Posts: 9
Joined: Sun Apr 09, 2017 1:10 pm

Building MAME with Visual Studio 2019

Hi,

Following the instructions at:

https://wiki.mamedev.org/index.php/Buil ... _compilers

and substituting "vs2019" for "vs2017" in make command line,

I created a solution for Visual Studio 2019 (I use Community edition).

In order to speed up the build, I changed all project files to use /MP (Parallel build) command switch in C++ options, but I don't see any significant increase in times.

I'm wondering if there's any other build tips you might recommend to speed it up?

My computer's no slouch, Athlon 3700x 8 core, 4.3Ghz, SSD, 16GB RAM. Have disabled AV so that it doesn't interfere with build.


Here's what I've tried:

When I have Tools | Options set to 16 parallel builds (max my setup supports) I get heap errors - looks like MSBuild runs out of RAM / VM.
I have checked my projects are using 64 bit toolset and I have updated my VS2019 community to very latest patch level.
All projects in solution have /MP switch enabled.


Here's what I'm thinking of trying - but would like your advice if poss before going down the road:
1. enabling precompiled headers
2. enabling minimal rebuild in all projects
3. Installing Incredibuild


Any new tips to speed up build would be appreciated.

User avatar
Stiletto
Posts: 71
Joined: Thu Nov 06, 2014 4:11 pm

Re: Building MAME with Visual Studio 2019

The main thing you might want to do is a SOURCES= build; that's the single thing that'll have the most impact on build times. Only build the stuff you want, while you are experimenting. That works with our makefile that uses GENIE.
https://docs.mamedev.org/initialsetup/c ... -platforms
- Stiletto

User avatar
stunstall
Posts: 9
Joined: Sun Apr 09, 2017 1:10 pm

Re: Building MAME with Visual Studio 2019

Stiletto wrote:
Thu Apr 08, 2021 2:05 am
The main thing you might want to do is a SOURCES= build; that's the single thing that'll have the most impact on build times. Only build the stuff you want, while you are experimenting. That works with our makefile that uses GENIE.
https://docs.mamedev.org/initialsetup/c ... -platforms
Thanks for your help. Much appreciated.

I want to add features to the debugger. Unsure what fileset I need for that, but I'll take a look :)


PS:
For anyone interested in compiling MAME with VS 2019:

Mame Docs (as linked to by Stiletto) says this:
"MAME can only be compiled with the Visual Studio 15.7.6 tools. Bugs in newer versions of the Microsoft Visual C/C++ compiler prevent it from compiling MAME."

That is incorrect. I can confirm I can build MAME with zero errors using Visual Studio 2019 Community edition.

Secondly, I installed Incredibuild and set the /MP switch for all projects so they build in parallel, and this does provide a *massive* speed increase in build times.

Incredibuild chews through compilation using all 16 logical processors. And it's free for single PC after trial expires, as mine has. disclaimer: I have no relation to company or authors or any employees whatsoever etc etc, never worked for them, never will :D

Return to “MAME Discussion”