Skip to content
Snippets Groups Projects
Commit 6baedc13 authored by Aimee Linden's avatar Aimee Linden
Browse files

VWR-20748 (SNOW-520) FIXED Make develop.py play nicely with express editions of Visual Studio

parent fcb24079
No related branches found
No related tags found
No related merge requests found
...@@ -521,6 +521,7 @@ Robin Cornelius ...@@ -521,6 +521,7 @@ Robin Cornelius
SNOW-484 SNOW-484
SNOW-506 SNOW-506
SNOW-514 SNOW-514
SNOW-520
SNOW-585 SNOW-585
VWR-2488 VWR-2488
VWR-9557 VWR-9557
......
...@@ -76,6 +76,7 @@ class PlatformSetup(object): ...@@ -76,6 +76,7 @@ class PlatformSetup(object):
distcc = True distcc = True
cmake_opts = [] cmake_opts = []
word_size = 32 word_size = 32
using_express = False
def __init__(self): def __init__(self):
self.script_dir = os.path.realpath( self.script_dir = os.path.realpath(
...@@ -497,9 +498,17 @@ class WindowsSetup(PlatformSetup): ...@@ -497,9 +498,17 @@ class WindowsSetup(PlatformSetup):
self._generator = version self._generator = version
print 'Building with ', self.gens[version]['gen'] print 'Building with ', self.gens[version]['gen']
break break
else: else:
print >> sys.stderr, 'Cannot find a Visual Studio installation!' print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions'
sys.exit(1) for version in 'vc80 vc90 vc71'.split():
if self.find_visual_studio_express(version):
self._generator = version
self.using_express = True
print 'Building with ', self.gens[version]['gen'] , "Express edition"
break
else:
print >> sys.stderr, 'Cannot find any Visual Studio installation'
sys.exit(1)
return self._generator return self._generator
def _set_generator(self, gen): def _set_generator(self, gen):
...@@ -562,6 +571,28 @@ class WindowsSetup(PlatformSetup): ...@@ -562,6 +571,28 @@ class WindowsSetup(PlatformSetup):
return '' return ''
def find_visual_studio_express(self, gen=None):
if gen is None:
gen = self._generator
gen = gen.lower()
try:
import _winreg
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s\Setup\VC' %
self.gens[gen]['ver'])
value_str = (r'ProductDir')
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
(key_str, value_str))
print key_str
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
key = _winreg.OpenKey(reg, key_str)
value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
print 'Found: %s' % value
return value
except WindowsError, err:
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
return ''
def get_build_cmd(self): def get_build_cmd(self):
if self.incredibuild: if self.incredibuild:
config = self.build_type config = self.build_type
...@@ -572,6 +603,17 @@ class WindowsSetup(PlatformSetup): ...@@ -572,6 +603,17 @@ class WindowsSetup(PlatformSetup):
cmd = "%(bin)s %(prj)s.sln /build /cfg=%(cfg)s" % {'prj': self.project_name, 'cfg': config, 'bin': executable} cmd = "%(bin)s %(prj)s.sln /build /cfg=%(cfg)s" % {'prj': self.project_name, 'cfg': config, 'bin': executable}
return (executable, cmd) return (executable, cmd)
environment = self.find_visual_studio()
if environment == '':
environment = self.find_visual_studio_express()
if environment == '':
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio installation."
else:
build_dirs=self.build_dirs();
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for express specific information"
exit(0)
# devenv.com is CLI friendly, devenv.exe... not so much. # devenv.com is CLI friendly, devenv.exe... not so much.
executable = '%sdevenv.com' % (self.find_visual_studio(),) executable = '%sdevenv.com' % (self.find_visual_studio(),)
cmd = ('"%s" %s.sln /build %s' % cmd = ('"%s" %s.sln /build %s' %
...@@ -603,7 +645,8 @@ class WindowsSetup(PlatformSetup): ...@@ -603,7 +645,8 @@ class WindowsSetup(PlatformSetup):
'''Override to add the vstool.exe call after running cmake.''' '''Override to add the vstool.exe call after running cmake.'''
PlatformSetup.run_cmake(self, args) PlatformSetup.run_cmake(self, args)
if self.unattended == 'OFF': if self.unattended == 'OFF':
self.run_vstool() if self.using_express == False:
self.run_vstool()
def run_vstool(self): def run_vstool(self):
for build_dir in self.build_dirs(): for build_dir in self.build_dirs():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment