From 8fa60cf0f49c872402aa72d486e1f900a166d951 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 18 Apr 2013 14:03:24 +1000 Subject: New branch for building with nmake. This is a branch, coz it's still crap. --- linden/indra/develop.py | 83 +++++++++++++++++++++------------ linden/indra/newview/CMakeLists.txt | 4 +- linden/indra/newview/viewer_manifest.py | 8 ++-- 3 files changed, 59 insertions(+), 36 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/develop.py b/linden/indra/develop.py index 3760609..3344288 100755 --- a/linden/indra/develop.py +++ b/linden/indra/develop.py @@ -485,6 +485,10 @@ class WindowsSetup(PlatformSetup): 'vc100' : { 'gen' : r'Visual Studio 10', 'ver' : r'10.0' + }, + 'nmake' : { + 'gen' : r'NMake Makefiles', + 'ver' : r'' } } gens['vs2003'] = gens['vc71'] @@ -510,7 +514,7 @@ class WindowsSetup(PlatformSetup): else: print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions' for version in 'vc80 vc90 vc100 vc71'.split(): - if self.find_visual_studio_express(version): + if self.find_visual_studio_express(version) != '': self._generator = version self.using_express = True print 'Building with ', self.gens[version]['gen'] , "Express edition" @@ -534,19 +538,33 @@ class WindowsSetup(PlatformSetup): def cmake_commandline(self, src_dir, build_dir, opts, simple): args = dict( dir=src_dir, - generator=self.gens[self.generator.lower()]['gen'], opts=quote(opts), standalone=self.standalone, unattended=self.unattended, - project_name=self.project_name + project_name=self.project_name, + type=self.build_type, + use_vstool='ON' ) + if self.generator == 'nmake': + args['generator'] = r'NMake Makefiles' + args['use_vstool'] = 'OFF' + else: + args['generator'] = self.gens[self.generator.lower()]['gen'] + if self.using_express: + args['using_express'] = 'ON' + args['use_vstool'] = 'OFF' + else: + args['using_express'] = 'OFF' # default to packaging disabled # if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' + '-DCMAKE_BUILD_TYPE:STRING=%(type)s ' '-DSTANDALONE:BOOL=%(standalone)s ' '-DUNATTENDED:BOOL=%(unattended)s ' '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' + '-DUSING_EXPRESS:BOOL=%(using_express)s ' + '-DUSE_VSTOOL:BOOL=%(use_vstool)s ' #'-DPACKAGE:BOOL=ON ' '%(opts)s "%(dir)s"' % args) @@ -602,7 +620,7 @@ class WindowsSetup(PlatformSetup): config = '\"%s|Win32\"' % config return "buildconsole %s.sln /build %s" % (self.project_name, config) - + environment = self.find_visual_studio() if environment == '': environment = self.find_visual_studio_express() @@ -614,7 +632,17 @@ class WindowsSetup(PlatformSetup): print >> sys.stderr, "Solution can now be found in:", build_dirs[0] print >> sys.stderr, "Set %s as startup project" % self.project_name print >> sys.stderr, "Set build target is Release or RelWithDbgInfo" - exit(0) + exit(0) + + if self.generator == 'nmake': + '''Hack around a bug in cmake that I'm surprised did not hit GUI controlled builds.''' + self.run(r'sed -i "s|\(^RC_FLAGS .* \) /GS .*$|\1|" build-nmake/win_crash_logger/CMakeFiles/windows-crash-logger.dir/flags.make') + self.run(r'sed -i "s|\(^RC_FLAGS .* \) /GS .*$|\1|" build-nmake/newview/CMakeFiles/imprudence-bin.dir/flags.make') + self.run(r'sed -i "s|\(^RC_FLAGS .* \) /EHsc .*/Zm1000 \($\)|\1\2|" build-nmake/win_crash_logger/CMakeFiles/windows-crash-logger.dir/flags.make') + self.run(r'sed -i "s|\(^RC_FLAGS .* \) /EHsc .*/Zm1000 \($\)|\1\2|" build-nmake/newview/CMakeFiles/imprudence-bin.dir/flags.make') + '''Evil hack.''' + self.run(r'touch newview/touched.bat') + return "nmake" # devenv.com is CLI friendly, devenv.exe... not so much. return ('"%sdevenv.com" %s.sln /build %s' % @@ -634,13 +662,6 @@ class WindowsSetup(PlatformSetup): raise CommandError('the command %r %s' % (name, ret)) - def run_cmake(self, args=[]): - '''Override to add the vstool.exe call after running cmake.''' - PlatformSetup.run_cmake(self, args) - if self.unattended == 'OFF': - if self.using_express == False: - self.run_vstool() - def run_vstool(self): for build_dir in self.build_dirs(): stamp = os.path.join(build_dir, 'vstool.txt') @@ -659,30 +680,30 @@ class WindowsSetup(PlatformSetup): print 'Running %r in %r' % (vstool_cmd, getcwd()) self.run(vstool_cmd) print >> open(stamp, 'w'), self.build_type - + def run_build(self, opts, targets): cwd = getcwd() build_cmd = self.get_build_cmd() - - for d in self.build_dirs(): - try: - os.chdir(d) - if targets: - for t in targets: - cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts)) + if build_cmd != "": + for d in self.build_dirs(): + try: + os.chdir(d) + if targets: + for t in targets: + cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts)) + print 'Running %r in %r' % (cmd, d) + self.run(cmd) + else: + cmd = '%s %s' % (build_cmd, ' '.join(opts)) print 'Running %r in %r' % (cmd, d) self.run(cmd) - else: - cmd = '%s %s' % (build_cmd, ' '.join(opts)) - print 'Running %r in %r' % (cmd, d) - self.run(cmd) - finally: - os.chdir(cwd) - + finally: + os.chdir(cwd) + class CygwinSetup(WindowsSetup): def __init__(self): super(CygwinSetup, self).__init__() - self.generator = 'vc80' + self.generator = 'nmake' def cmake_commandline(self, src_dir, build_dir, opts, simple): dos_dir = commands.getoutput("cygpath -w %s" % src_dir) @@ -692,11 +713,13 @@ class CygwinSetup(WindowsSetup): opts=quote(opts), standalone=self.standalone, unattended=self.unattended, - project_name=self.project_name + project_name=self.project_name, + type=self.build_type ) #if simple: # return 'cmake %(opts)s "%(dir)s"' % args return ('cmake -G "%(generator)s" ' + '-DCMAKE_BUILD_TYPE:STRING=%(type)s ' '-DUNATTENDED:BOOl=%(unattended)s ' '-DSTANDALONE:BOOL=%(standalone)s ' '-DROOT_PROJECT_NAME:STRING=%(project_name)s ' @@ -723,7 +746,7 @@ Options: -m32 | -m64 build architecture (32-bit or 64-bit) -N | --no-distcc disable use of distcc -G | --generator=NAME generator name - Windows: VC80 (VS2005--default), VC71 (VS2003), + Windows: NMake, VC80 (VS2005--default), VC71 (VS2003), VC90 (VS2008), or VC100 (VS2010) Mac OS X: Xcode (default), Unix Makefiles Linux: Unix Makefiles (default), KDevelop3 diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index b9c41fc..9172aa0 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -1326,7 +1326,7 @@ if (WINDOWS) # sets the 'working directory' for debugging from visual studio. if (NOT UNATTENDED) - if (NOT self.using_express) + if (USE_VSTOOL) add_custom_command( TARGET ${VIEWER_BINARY_NAME} PRE_BUILD COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe @@ -1338,7 +1338,7 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." ) - endif (NOT self.using_express) + endif (USE_VSTOOL) endif (NOT UNATTENDED) add_custom_command( diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py index bcdf4a9..718c3d2 100755 --- a/linden/indra/newview/viewer_manifest.py +++ b/linden/indra/newview/viewer_manifest.py @@ -244,7 +244,7 @@ class WindowsManifest(ViewerManifest): elif self.configuration().lower() == "debug": self.path(self.find_existing_file('debug/imprudence-bin.exe'), dst=self.final_exe()) else: - self.path(self.find_existing_file('release/imprudence-bin.exe', 'releasesse2/imprudence-bin.exe', 'relwithdebinfo/imprudence-bin.exe', 'debug/imprudence-bin.exe'), dst=self.final_exe()) + self.path(self.find_existing_file('release/imprudence-bin.exe', 'releasesse2/imprudence-bin.exe', 'relwithdebinfo/imprudence-bin.exe', 'debug/imprudence-bin.exe', 'imprudence-bin.exe'), dst=self.final_exe()) # copy over the the pdb file for the regular or SSE2 versions if we don't already have one copied symbol_ver = '.'.join(self.args['version']) @@ -281,7 +281,7 @@ class WindowsManifest(ViewerManifest): #self.path("fmod.dll") # For spellchecking - if self.prefix(src=self.args['configuration'], dst=""): + if self.prefix(src=os.path.join(self.args['configuration'], "Release"), dst=""): self.path("libhunspell.dll") self.end_prefix() @@ -289,12 +289,12 @@ class WindowsManifest(ViewerManifest): self.path("llkdu.dll.2.config") # Get llcommon and deps. - if self.prefix(src=self.args['configuration'], dst=""): + if self.prefix(src=os.path.join(self.args['configuration'], "Release"), dst=""): self.path('libapr-1.dll') self.path('libaprutil-1.dll') self.path('libapriconv-1.dll') - self.path('llcommon.dll') self.end_prefix() + self.path('llcommon.dll') # For textures if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""): -- cgit v1.1