Dota 2 support in Ambuild scripts (bug 5656, r=asherkin).

This commit is contained in:
Nicholas Hastings 2013-03-19 11:22:31 -04:00
parent e364937353
commit 2c7537b4cd
2 changed files with 22 additions and 4 deletions

View File

@ -62,6 +62,9 @@ class SM:
self.possibleSdks['csgo'] = {'sdk': 'HL2SDKCSGO', 'ext': '2.csgo', 'def': '12',
'name': 'CSGO', 'platform': ['windows', 'linux', 'darwin'],
'dir': 'hl2sdk-csgo'}
self.possibleSdks['dota'] = {'sdk': 'HL2SDKDOTA', 'ext': '2.dota', 'def': '13',
'name': 'DOTA', 'platform': ['windows'],
'dir': 'hl2sdk-dota'}
# self.possibleSdks['portal2'] = {'sdk': 'HL2SDK-PORTAL2', 'ext': '2.portal2', 'def': '11',
# 'name': 'PORTAL2', 'platform': ['windows'],
# 'dir': 'hl2sdk-portal2'}
@ -341,7 +344,7 @@ class SM:
job.AddCommand(SymlinkCommand(link, target))
elif AMBuild.target['platform'] == 'windows':
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
if sdk in ['swarm', 'csgo']:
if sdk in ['swarm', 'csgo', 'dota']:
libs.append('interfaces')
for lib in libs:
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'

View File

@ -18,12 +18,17 @@ for i in SM.sdkInfo:
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.3.0', 'src'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'csgo', 'protobuf'))
elif i == 'dota':
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.4.1', 'src'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'protobuf'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'dota', 'protobuf'))
extension = AMBuild.AddJob(name)
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
SM.PreSetupHL2Job(extension, binary, i)
if i == 'csgo':
if i in ['csgo', 'dota']:
if AMBuild.target['platform'] == 'linux':
link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'linux32', 'release'), 'libprotobuf.a')
@ -98,7 +103,7 @@ for i in SM.sdkInfo:
'ConsoleDetours.cpp'
]
if i == 'csgo':
if i in ['csgo', 'dota']:
files.append('smn_protobuf.cpp')
else:
files.append('smn_bitbuffer.cpp')
@ -112,10 +117,20 @@ for i in SM.sdkInfo:
os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
]
binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
elif i == 'dota':
files = [
os.path.join('public', 'engine', 'protobuf', 'netmessages.pb.cc'),
os.path.join('public', 'game', 'shared', 'protobuf', 'ai_activity.pb.cc'),
os.path.join('public', 'game', 'shared', 'protobuf', 'usermessages.pb.cc'),
os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_commonmessages.pb.cc'),
os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessages.pb.cc'),
os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessage_helpers.cpp'),
]
binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
SM.PostSetupHL2Job(extension, binary, i)
if i == 'csgo':
if i in ['csgo', 'dota']:
if AMBuild.target['platform'] in ['linux', 'darwin']:
binary.AddObjectFiles(['libprotobuf.a'])