Dota 2 support in Ambuild scripts (bug 5656, r=asherkin).
authorNicholas Hastings <skamonkey@gmail.com>
Tue Mar 19 11:22:31 2013 -0400 (2013-03-19)
changeset 3856549960ebe23c
parent 3855 d8ba5eddf543
child 3857 3fd1717664b3
Dota 2 support in Ambuild scripts (bug 5656, r=asherkin).
AMBuildScript
core/AMBuilder
     1.1 --- a/AMBuildScript	Tue Mar 19 11:19:38 2013 -0400
     1.2 +++ b/AMBuildScript	Tue Mar 19 11:22:31 2013 -0400
     1.3 @@ -62,6 +62,9 @@
     1.4  		self.possibleSdks['csgo'] =  {'sdk': 'HL2SDKCSGO',     'ext': '2.csgo',  'def': '12',
     1.5  		                         'name': 'CSGO',           'platform': ['windows', 'linux', 'darwin'],
     1.6  		                         'dir': 'hl2sdk-csgo'}
     1.7 +		self.possibleSdks['dota'] =  {'sdk': 'HL2SDKDOTA',     'ext': '2.dota',  'def': '13',
     1.8 +		                         'name': 'DOTA',           'platform': ['windows'],
     1.9 +		                         'dir': 'hl2sdk-dota'}
    1.10  		# self.possibleSdks['portal2'] =  {'sdk': 'HL2SDK-PORTAL2',     'ext': '2.portal2',  'def': '11',
    1.11  		#                        'name': 'PORTAL2',           'platform': ['windows'],
    1.12  		#                        'dir': 'hl2sdk-portal2'}
    1.13 @@ -341,7 +344,7 @@
    1.14  					job.AddCommand(SymlinkCommand(link, target))
    1.15  		elif AMBuild.target['platform'] == 'windows':
    1.16  			libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
    1.17 -			if sdk in ['swarm', 'csgo']:
    1.18 +			if sdk in ['swarm', 'csgo', 'dota']:
    1.19  				libs.append('interfaces')
    1.20  			for lib in libs:
    1.21  				libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
     2.1 --- a/core/AMBuilder	Tue Mar 19 11:19:38 2013 -0400
     2.2 +++ b/core/AMBuilder	Tue Mar 19 11:22:31 2013 -0400
     2.3 @@ -18,12 +18,17 @@
     2.4  		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.3.0', 'src'))
     2.5  		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
     2.6  		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'csgo', 'protobuf'))
     2.7 +	elif i == 'dota':
     2.8 +		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.4.1', 'src'))
     2.9 +		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
    2.10 +		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'protobuf'))
    2.11 +		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'dota', 'protobuf'))
    2.12  
    2.13  	extension = AMBuild.AddJob(name)
    2.14  	binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
    2.15  	SM.PreSetupHL2Job(extension, binary, i)
    2.16  
    2.17 -	if i == 'csgo':
    2.18 +	if i in ['csgo', 'dota']:
    2.19  		if AMBuild.target['platform'] == 'linux':
    2.20  			link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
    2.21  			target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'linux32', 'release'), 'libprotobuf.a')
    2.22 @@ -98,7 +103,7 @@
    2.23  		'ConsoleDetours.cpp'
    2.24  		]
    2.25  	
    2.26 -	if i == 'csgo':
    2.27 +	if i in ['csgo', 'dota']:
    2.28  		files.append('smn_protobuf.cpp')
    2.29  	else:
    2.30  		files.append('smn_bitbuffer.cpp')
    2.31 @@ -112,10 +117,20 @@
    2.32  			os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
    2.33  			]
    2.34  		binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
    2.35 +	elif i == 'dota':
    2.36 +		files = [
    2.37 +			os.path.join('public', 'engine', 'protobuf', 'netmessages.pb.cc'),
    2.38 +			os.path.join('public', 'game', 'shared', 'protobuf', 'ai_activity.pb.cc'),
    2.39 +			os.path.join('public', 'game', 'shared', 'protobuf', 'usermessages.pb.cc'),
    2.40 +			os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_commonmessages.pb.cc'),
    2.41 +			os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessages.pb.cc'),
    2.42 +			os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessage_helpers.cpp'),
    2.43 +			]
    2.44 +		binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
    2.45  
    2.46  	SM.PostSetupHL2Job(extension, binary, i)
    2.47  	
    2.48 -	if i == 'csgo':
    2.49 +	if i in ['csgo', 'dota']:
    2.50  		if AMBuild.target['platform'] in ['linux', 'darwin']:
    2.51  			binary.AddObjectFiles(['libprotobuf.a'])
    2.52