1.1 --- a/AMBuildScript Fri Dec 16 09:43:05 2011 -0500
1.2 +++ b/AMBuildScript Thu Feb 16 19:26:49 2012 +0000
1.3 @@ -2,6 +2,7 @@
1.4 import os
1.5 import sys
1.6 from ambuild.command import SymlinkCommand
1.7 +from ambuild.command import ShellCommand
1.8
1.9 class SM:
1.10 def __init__(self):
1.11 @@ -113,6 +114,7 @@
1.12 self.compiler.AddToListVar('CFLAGS', '-Wno-switch')
1.13 self.compiler.AddToListVar('CFLAGS', '-msse')
1.14 self.compiler.AddToListVar('CFLAGS', '-m32')
1.15 + self.compiler.AddToListVar('CFLAGS', '-g3')
1.16 self.compiler.AddToListVar('POSTLINKFLAGS', '-m32')
1.17 self.compiler.AddToListVar('CXXFLAGS', '-fno-exceptions')
1.18 self.compiler.AddToListVar('CXXFLAGS', '-fno-rtti')
1.19 @@ -169,9 +171,7 @@
1.20 if AMBuild.options.debug == '1':
1.21 self.compiler.AddToListVar('CDEFINES', 'DEBUG')
1.22 self.compiler.AddToListVar('CDEFINES', '_DEBUG')
1.23 - if self.vendor == 'gcc' or self.vendor == 'clang':
1.24 - self.compiler.AddToListVar('CFLAGS', '-g3')
1.25 - elif self.vendor == 'msvc':
1.26 + if self.vendor == 'msvc':
1.27 self.compiler.AddToListVar('CFLAGS', '/Od')
1.28 self.compiler.AddToListVar('CFLAGS', '/RTC1')
1.29
1.30 @@ -257,6 +257,17 @@
1.31 else:
1.32 return
1.33
1.34 + def StripBinary(self, job, binary):
1.35 + workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
1.36 + src = os.path.join('..', workFolder, binary.binaryFile)
1.37 + if AMBuild.target['platform'] == 'linux':
1.38 + job.AddCommand(ShellCommand('objcopy --only-keep-debug ' + src + ' ' + src + '.dbg'))
1.39 + job.AddCommand(ShellCommand('objcopy --strip-debug ' + src))
1.40 + job.AddCommand(ShellCommand('objcopy --add-gnu-debuglink=' + src + '.dbg ' + src))
1.41 + elif AMBuild.target['platform'] == 'darwin':
1.42 + job.AddCommand(ShellCommand('dsymutil ' + src))
1.43 + job.AddCommand(ShellCommand('strip -S ' + src))
1.44 +
1.45 def PreSetupHL2Job(self, job, builder, sdk):
1.46 info = self.sdkInfo[sdk]
1.47 sdkPath = AMBuild.cache[info['sdk']]
1.48 @@ -304,7 +315,7 @@
1.49 def PostSetupHL2Job(self, job, builder, sdk):
1.50 if AMBuild.target['platform'] in ['linux', 'darwin']:
1.51 builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
1.52 -
1.53 +
1.54 def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
1.55 compiler = self.DefaultExtCompiler(path)
1.56