1.1 --- a/core/AMBuilder Mon Jan 07 09:09:14 2013 -0500
1.2 +++ b/core/AMBuilder Tue Jan 22 21:43:12 2013 -0500
1.3 @@ -1,5 +1,6 @@
1.4 # vim: set ts=2 sw=2 tw=99 noet ft=python:
1.5 import os
1.6 +from ambuild.command import SymlinkCommand
1.7
1.8 for i in SM.sdkInfo:
1.9 sdk = SM.sdkInfo[i]
1.10 @@ -10,9 +11,35 @@
1.11
1.12 compiler = SM.DefaultHL2Compiler('core', i)
1.13
1.14 + if i == 'csgo':
1.15 + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.3.0', 'src'))
1.16 + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
1.17 + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'csgo', 'protobuf'))
1.18 +
1.19 extension = AMBuild.AddJob(name)
1.20 binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
1.21 SM.PreSetupHL2Job(extension, binary, i)
1.22 +
1.23 + if i == 'csgo':
1.24 + if AMBuild.target['platform'] == 'linux':
1.25 + link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
1.26 + target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'linux32', 'release'), 'libprotobuf.a')
1.27 + try:
1.28 + os.lstat(link)
1.29 + except:
1.30 + extension.AddCommand(SymlinkCommand(link, target))
1.31 + elif AMBuild.target['platform'] == 'darwin':
1.32 + link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
1.33 + target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'osx32', 'release'), 'libprotobuf.a')
1.34 + try:
1.35 + os.lstat(link)
1.36 + except:
1.37 + extension.AddCommand(SymlinkCommand(link, target))
1.38 + elif AMBuild.target['platform'] == 'windows':
1.39 + libPath = os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'win32', 'release', 'vs2010', 'libprotobuf.lib')
1.40 + binary.RebuildIfNewer(libPath)
1.41 + binary['POSTLINKFLAGS'].append(libPath)
1.42 +
1.43 files = [
1.44 'AdminCache.cpp',
1.45 'ExtensionSys.cpp',
1.46 @@ -49,7 +76,6 @@
1.47 'CoreConfig.cpp',
1.48 'Logger.cpp',
1.49 'PluginInfoDatabase.cpp',
1.50 - 'smn_bitbuffer.cpp',
1.51 'smn_halflife.cpp',
1.52 'PluginSys.cpp',
1.53 'smn_console.cpp',
1.54 @@ -71,7 +97,22 @@
1.55 'sm_srvcmds.cpp',
1.56 'ConsoleDetours.cpp'
1.57 ]
1.58 +
1.59 + if i == 'csgo':
1.60 + files.append('smn_protobuf.cpp')
1.61 + else:
1.62 + files.append('smn_bitbuffer.cpp')
1.63 +
1.64 binary.AddSourceFiles('core', files)
1.65 +
1.66 + if i == 'csgo':
1.67 + files = [
1.68 + os.path.join('public', 'engine', 'protobuf', 'netmessages.pb.cc'),
1.69 + os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
1.70 + os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
1.71 + ]
1.72 + binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
1.73 +
1.74 SM.PostSetupHL2Job(extension, binary, i)
1.75 SM.AutoVersion('core', binary)
1.76 binary.SendToJob()