This commit is contained in:
Asher Baker 2012-04-14 01:14:14 +01:00
commit cd729f054c
18 changed files with 20 additions and 34 deletions

View File

@ -2,7 +2,6 @@
import os
import sys
from ambuild.command import SymlinkCommand
from ambuild.command import ShellCommand
class SM:
def __init__(self):
@ -115,7 +114,6 @@ class SM:
self.compiler.AddToListVar('CFLAGS', '-Wno-switch')
self.compiler.AddToListVar('CFLAGS', '-msse')
self.compiler.AddToListVar('CFLAGS', '-m32')
self.compiler.AddToListVar('CFLAGS', '-g3')
self.compiler.AddToListVar('POSTLINKFLAGS', '-m32')
self.compiler.AddToListVar('CXXFLAGS', '-fno-exceptions')
self.compiler.AddToListVar('CXXFLAGS', '-fno-rtti')
@ -175,7 +173,9 @@ class SM:
if AMBuild.options.debug == '1':
self.compiler.AddToListVar('CDEFINES', 'DEBUG')
self.compiler.AddToListVar('CDEFINES', '_DEBUG')
if self.vendor == 'msvc':
if self.vendor == 'gcc' or self.vendor == 'clang':
self.compiler.AddToListVar('CFLAGS', '-g3')
elif self.vendor == 'msvc':
self.compiler.AddToListVar('CFLAGS', '/Od')
self.compiler.AddToListVar('CFLAGS', '/RTC1')
@ -259,19 +259,6 @@ class SM:
else:
return
def StripBinary(self, job, binary):
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
src = os.path.join('..', workFolder, binary.binaryFile)
if not binary.NeedsRelink(src):
return;
if AMBuild.target['platform'] == 'linux':
job.AddCommand(ShellCommand('objcopy --only-keep-debug ' + src + ' ' + src + '.dbg'))
job.AddCommand(ShellCommand('objcopy --strip-debug ' + src))
job.AddCommand(ShellCommand('objcopy --add-gnu-debuglink=' + src + '.dbg ' + src))
elif AMBuild.target['platform'] == 'darwin':
job.AddCommand(ShellCommand('dsymutil ' + src))
job.AddCommand(ShellCommand('strip -S ' + src))
def PreSetupHL2Job(self, job, builder, sdk):
info = self.sdkInfo[sdk]
sdkPath = AMBuild.cache[info['sdk']]

View File

@ -75,4 +75,4 @@ for i in SM.sdkInfo:
SM.PostSetupHL2Job(extension, binary, i)
SM.AutoVersion('core', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -56,5 +56,4 @@ else:
binary.AddSourceFiles('core/logic', files)
SM.AutoVersion('core/logic', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -20,4 +20,5 @@ binary.AddSourceFiles('extensions/bintools', [
])
SM.AutoVersion('extensions/bintools', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -16,4 +16,4 @@ binary.AddSourceFiles('extensions/clientprefs', [
])
SM.AutoVersion('extensions/clientprefs', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -22,5 +22,4 @@ if AMBuild.target['platform'] in sdk['platform']:
])
SM.PostSetupHL2Job(extension, binary, 'ep2v')
SM.AutoVersion('extensions/cstrike', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)
binary.SendToJob()

View File

@ -83,4 +83,4 @@ elif AMBuild.target['platform'] == 'windows':
SM.AutoVersion('extensions/curl', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -12,4 +12,4 @@ if AMBuild.target['platform'] == 'windows':
binary['POSTLINKFLAGS'].append('wsock32.lib')
SM.AutoVersion('extensions/geoip', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -35,4 +35,4 @@ binary.AddSourceFiles('extensions/mysql', [
])
SM.AutoVersion('extensions/mysql', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -24,4 +24,4 @@ binary.AddSourceFiles('extensions/regex', [
])
SM.AutoVersion('extensions/regex', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -49,4 +49,4 @@ for i in SM.sdkInfo:
SM.PostSetupHL2Job(extension, binary, i)
SM.AutoVersion('extensions/sdktools', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -37,4 +37,4 @@ elif AMBuild.target['platform'] == 'linux' or AMBuild.target['platform'] == 'dar
binary.AddSourceFiles('extensions/sqlite', files)
SM.AutoVersion('extensions/sqlite', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -26,4 +26,4 @@ binary.AddSourceFiles('extensions/tf2', [
SM.PostSetupHL2Job(extension, binary, 'ep2v')
SM.AutoVersion('extensions/tf2', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -16,4 +16,4 @@ binary.AddSourceFiles('extensions/topmenus', [
])
SM.AutoVersion('extensions/topmenus', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -15,4 +15,4 @@ binary.AddSourceFiles('extensions/updater', [
])
SM.AutoVersion('extensions/updater', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -18,4 +18,4 @@ binary.AddSourceFiles('loader', [
])
SM.AutoVersion('loader', binary)
binary.SendToJob()
SM.StripBinary(loader, binary)

View File

@ -65,4 +65,4 @@ if AMBuild.target['platform'] == 'windows':
binary.AddResourceFile('sourcepawn/compiler/libpawnc.rc', env)
binary.SendToJob()
SM.StripBinary(extension, binary)

View File

@ -40,4 +40,4 @@ binary.AddSourceFiles('sourcepawn/jit', [
])
SM.AutoVersion('sourcepawn/jit', binary)
binary.SendToJob()
SM.StripBinary(extension, binary)