1.1 --- a/AMBuildScript Sun May 27 02:16:08 2012 +0100
1.2 +++ b/AMBuildScript Sun May 27 02:16:48 2012 +0100
1.3 @@ -27,6 +27,10 @@
1.4 'name': 'BLOODYGOODTIME', 'platform': ['windows']}
1.5 self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5',
1.6 'name': 'EYE', 'platform': ['windows']}
1.7 + self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '11',
1.8 + 'name': 'CSGO', 'platform': ['windows', 'linux']}
1.9 + # self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '10',
1.10 + # 'name': 'PORTAL2', 'platform': ['windows']}
1.11
1.12 self.sdkInfo = { }
1.13
1.14 @@ -39,6 +43,7 @@
1.15 if AMBuild.target['platform'] != 'darwin':
1.16 envvars['HL2SDK'] = 'hl2sdk'
1.17 envvars['HL2SDKOB'] = 'hl2sdk-ob'
1.18 + envvars['HL2SDKCSGO'] = 'hl2sdk-csgo'
1.19
1.20 envvars['HL2SDKOBVALVE'] = 'hl2sdk-ob-valve'
1.21 envvars['HL2SDKL4D'] = 'hl2sdk-l4d'
1.22 @@ -118,7 +123,7 @@
1.23 self.compiler.AddToListVar('CXXFLAGS', '-fno-threadsafe-statics')
1.24 self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor')
1.25 self.compiler.AddToListVar('CXXFLAGS', '-Wno-overloaded-virtual')
1.26 - if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 3) or \
1.27 + if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 7) or \
1.28 (self.vendor == 'clang' and cxx.majorVersion >= 3):
1.29 self.compiler.AddToListVar('CXXFLAGS', '-Wno-delete-non-virtual-dtor')
1.30 self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H')
1.31 @@ -256,10 +261,13 @@
1.32 else:
1.33 staticLibs = os.path.join(sdkPath, 'lib', 'linux')
1.34 workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
1.35 - if sdk in ['ep2v', 'l4d', 'l4d2']:
1.36 - for i in ['tier1_i486.a', 'libvstdlib.so', 'libtier0.so']:
1.37 - link = os.path.join(workFolder, i)
1.38 - target = os.path.join(staticLibs, i)
1.39 + if sdk in ['ep2v', 'l4d', 'l4d2', 'csgo']:
1.40 + libs = ['tier1_i486.a', 'libvstdlib.so', 'libtier0.so']
1.41 + if sdk == 'csgo':
1.42 + libs.insert(0, 'interfaces_i486.a')
1.43 + for lib in libs:
1.44 + link = os.path.join(workFolder, lib)
1.45 + target = os.path.join(staticLibs, lib)
1.46 try:
1.47 os.lstat(link)
1.48 except:
1.49 @@ -275,16 +283,19 @@
1.50 elif AMBuild.target['platform'] == 'darwin':
1.51 staticLibs = os.path.join(sdkPath, 'lib', 'mac')
1.52 workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
1.53 - for i in ['tier1_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']:
1.54 - link = os.path.join(workFolder, i)
1.55 - target = os.path.join(staticLibs, i)
1.56 + libs = ['tier1_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']
1.57 + if sdk == 'csgo':
1.58 + libs.append('interfaces_i486.a')
1.59 + for lib in libs:
1.60 + link = os.path.join(workFolder, lib)
1.61 + target = os.path.join(staticLibs, lib)
1.62 try:
1.63 os.lstat(link)
1.64 except:
1.65 job.AddCommand(SymlinkCommand(link, target))
1.66 elif AMBuild.target['platform'] == 'windows':
1.67 libs = ['tier0', 'tier1', 'vstdlib']
1.68 - if sdk == 'swarm':
1.69 + if sdk in ['swarm', 'csgo']:
1.70 libs.append('interfaces')
1.71 for lib in libs:
1.72 libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
1.73 @@ -294,6 +305,8 @@
1.74 def PostSetupHL2Job(self, job, builder, sdk):
1.75 if AMBuild.target['platform'] in ['linux', 'darwin']:
1.76 builder.AddObjectFiles(['tier1_i486.a'])
1.77 + if( sdk == 'csgo' ):
1.78 + builder.AddObjectFiles(['interfaces_i486.a'])
1.79
1.80 def DefaultHL2Compiler(self, path, sdk, noLink = False):
1.81 compiler = self.DefaultCompiler()
1.82 @@ -304,6 +317,10 @@
1.83
1.84 info = self.possibleSdks
1.85 compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info])
1.86 +
1.87 + # We don't build for Portal 2 (yet?, ever?), but using this define in code as
1.88 + # it saves trouble if we ever need to
1.89 + compiler['CDEFINES'].append('SE_PORTAL2=10')
1.90
1.91 paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'],
1.92 ['public', 'tier0'], ['public', 'tier1']]
1.93 @@ -320,8 +337,11 @@
1.94
1.95 compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
1.96
1.97 - if sdk == 'swarm' and AMBuild.target['platform'] == 'windows':
1.98 - compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
1.99 + if sdk in ['swarm', 'csgo']:
1.100 + if AMBuild.target['platform'] == 'windows':
1.101 + compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
1.102 + else:
1.103 + compiler['CDEFINES'].extend(['COMPILER_GCC', 'POSIX'])
1.104
1.105 if sdk == 'ep1':
1.106 if AMBuild.target['platform'] == 'linux':
1.107 @@ -338,7 +358,7 @@
1.108 if not noLink:
1.109 if AMBuild.target['platform'] == 'linux':
1.110 compiler['POSTLINKFLAGS'][0:0] = ['-lm']
1.111 - if sdk in ['ep2v', 'l4d', 'l4d2']:
1.112 + if sdk in ['ep2v', 'l4d', 'l4d2', 'csgo']:
1.113 compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
1.114 compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
1.115 else: