Bug 1260299 - Generate Visual Studio project files corresponding to current toolchain; r?chmanchester draft
authorGregory Szorc <gps@mozilla.com>
Thu, 19 May 2016 20:08:46 -0700
changeset 369052 c7323d81b54c02a06fe966f9c5215fb1ccf8e6fa
parent 369051 eb47ee77793bf0bba923b24cbc6a6150d4c57c63
child 369053 95779ee5d5babde81e3185747b7b7e2050e94775
push id18715
push userbmo:gps@mozilla.com
push dateFri, 20 May 2016 04:59:11 +0000
reviewerschmanchester
bugs1260299
milestone49.0a1
Bug 1260299 - Generate Visual Studio project files corresponding to current toolchain; r?chmanchester If we're running VS2013, we generate VS2013 files. If we're running VS2015, we generate VS2015 files. If we don't have a Visual Studio version defined, refuse to generate project files (hopefully this doesn't happen in the real world but I'm sure someone will complain if it does). MozReview-Commit-ID: 5GdsbGmWPLB
python/mozbuild/mozbuild/backend/visualstudio.py
--- a/python/mozbuild/mozbuild/backend/visualstudio.py
+++ b/python/mozbuild/mozbuild/backend/visualstudio.py
@@ -69,18 +69,20 @@ class VisualStudioBackend(CommonBackend)
     """
 
     def _init(self):
         CommonBackend._init(self)
 
         # These should eventually evolve into parameters.
         self._out_dir = os.path.join(self.environment.topobjdir, 'msvc')
         self._projsubdir = 'projects'
-        # But making this one a parameter requires testing first.
-        self._version = '2013'
+
+        self._version = self.environment.substs.get('MSVS_VERSION', None)
+        if not self._version:
+            raise Exception('MSVS_VERSION not defined; this should never happen')
 
         self._paths_to_sources = {}
         self._paths_to_includes = {}
         self._paths_to_defines = {}
         self._paths_to_configs = {}
         self._libs_to_paths = {}
         self._progs_to_paths = {}