Bug 1275297 - Create Visual Studio project files by default on Windows; r=glandium

Now that the VisualStudio backend will no-op if nothing has changed, it
should be safe to always run this backend.

On first run, backend generation takes ~3.5s on my machine. On subsequent run,
it takes ~1.5s. Wall time for a no-op config.status is now ~15.7s. We could like
make the Visual Studio backend faster by not writing so many project files.
But this would require consolidating libraries in moz.build files. And that's
out of scope for this change.

We drop the check for MSVS_VERSION because it won't always be defined on
MinGW/GCC builds. We simply default to "2015" if it isn't set.

MozReview-Commit-ID: 5W38HMGmcuV

--HG--
extra : rebase_source : 302d76277058819c115f3c2518b8cb2067971950
extra : source : 408319d87eacb28848efeab0346eb815440adade
This commit is contained in:
Gregory Szorc 2016-05-24 08:47:24 -07:00
Родитель dbe050fbc3
Коммит 2d6fb1ed77
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -109,12 +109,15 @@ def build_backends_choices(help):
option('--enable-build-backend', nargs='+', choices=build_backends_choices,
help='Enable additional build backends')
@depends('--enable-build-backend', '--enable-artifact-builds')
def build_backend(backends, artifact_builds):
@depends('--enable-build-backend', '--enable-artifact-builds', target,
compile_environment)
def build_backend(backends, artifact_builds, target, compile_environment):
if artifact_builds:
all_backends = ['FasterMake+RecursiveMake']
else:
all_backends = ['RecursiveMake', 'FasterMake']
if target.os == 'WINNT' and compile_environment:
all_backends.append('VisualStudio')
all_backends.extend(backends)
return unique_list(all_backends)

Просмотреть файл

@ -70,9 +70,7 @@ class VisualStudioBackend(CommonBackend):
self._out_dir = os.path.join(self.environment.topobjdir, 'msvc')
self._projsubdir = 'projects'
self._version = self.environment.substs.get('MSVS_VERSION', None)
if not self._version:
raise Exception('MSVS_VERSION not defined; this should never happen')
self._version = self.environment.substs.get('MSVS_VERSION', '2015')
self._paths_to_sources = {}
self._paths_to_includes = {}