aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/develop.py
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/develop.py')
-rwxr-xr-xlinden/indra/develop.py48
1 files changed, 45 insertions, 3 deletions
diff --git a/linden/indra/develop.py b/linden/indra/develop.py
index 370a008..6388592 100755
--- a/linden/indra/develop.py
+++ b/linden/indra/develop.py
@@ -482,8 +482,15 @@ class WindowsSetup(PlatformSetup):
482 print 'Building with ', self.gens[version]['gen'] 482 print 'Building with ', self.gens[version]['gen']
483 break 483 break
484 else: 484 else:
485 print >> sys.stderr, 'Cannot find a Visual Studio installation!' 485 print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions'
486 eys.exit(1) 486 for version in 'vc80 vc90 vc71'.split():
487 if self.find_visual_studio_express(version):
488 self._generator = version
489 print 'Building with ', self.gens[version]['gen'] , "Express edition"
490 break
491 else:
492 print >> sys.stderr, 'Cannot find any Visual Studio installation'
493 eys.exit(1)
487 return self._generator 494 return self._generator
488 495
489 def _set_generator(self, gen): 496 def _set_generator(self, gen):
@@ -536,6 +543,28 @@ class WindowsSetup(PlatformSetup):
536 print >> sys.stderr, "Didn't find ", self.gens[gen]['gen'] 543 print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
537 return '' 544 return ''
538 545
546 def find_visual_studio_express(self, gen=None):
547 if gen is None:
548 gen = self._generator
549 gen = gen.lower()
550 try:
551 import _winreg
552 key_str = (r'SOFTWARE\Microsoft\VCExpress\%s\Setup\VC' %
553 self.gens[gen]['ver'])
554 value_str = (r'ProductDir')
555 print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
556 (key_str, value_str))
557 print key_str
558
559 reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
560 key = _winreg.OpenKey(reg, key_str)
561 value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
562 print 'Found: %s' % value
563 return value
564 except WindowsError, err:
565 print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
566 return ''
567
539 def get_build_cmd(self): 568 def get_build_cmd(self):
540 if self.incredibuild: 569 if self.incredibuild:
541 config = self.build_type 570 config = self.build_type
@@ -543,10 +572,23 @@ class WindowsSetup(PlatformSetup):
543 config = '\"%s|Win32\"' % config 572 config = '\"%s|Win32\"' % config
544 573
545 return "buildconsole %s.sln /build %s" % (self.project_name, config) 574 return "buildconsole %s.sln /build %s" % (self.project_name, config)
575
576 environment = self.find_visual_studio()
577 if environment == '':
578 environment = self.find_visual_studio_express()
579 if environment == '':
580 print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
581 else:
582 print >> sys.stderr, "\nSolution generation complete, as you are using an express edition the final\n stages will need to be completed by hand"
583 build_dirs=self.build_dirs();
584 print >> sys.stderr, "Solution can now be found in:", build_dirs[0]
585 print >> sys.stderr, "Set %s as startup project" % self.project_name
586 print >> sys.stderr, "Set build target is Release or RelWithDbgInfo"
587 exit(0)
546 588
547 # devenv.com is CLI friendly, devenv.exe... not so much. 589 # devenv.com is CLI friendly, devenv.exe... not so much.
548 return ('"%sdevenv.com" %s.sln /build %s' % 590 return ('"%sdevenv.com" %s.sln /build %s' %
549 (self.find_visual_studio(), self.project_name, self.build_type)) 591 (environment, self.project_name, self.build_type))
550 592
551 def run(self, command, name=None): 593 def run(self, command, name=None):
552 '''Run a program. If the program fails, raise an exception.''' 594 '''Run a program. If the program fails, raise an exception.'''