Triggering build.
1 # vim: set ts=2 sw=2 tw=99 noet ft=python:
3 from ambuild.command import SymlinkCommand
7 if AMBuild.target['platform'] not in sdk['platform']:
10 name = 'sourcemod.' + sdk['ext']
12 compiler = SM.DefaultHL2Compiler('core', i)
15 # Protobuf 2.3 headers have some signed/unsigned compares. I believe that it's fixed in later versions, but Valve.
16 if isinstance(compiler.cxx, Cpp.CompatGCC):
17 compiler.AddToListVar('CFLAGS', '-Wno-sign-compare')
18 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.3.0', 'src'))
19 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
20 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'csgo', 'protobuf'))
22 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'common', 'protobuf-2.4.1', 'src'))
23 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'engine', 'protobuf'))
24 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'protobuf'))
25 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'public', 'game', 'shared', 'dota', 'protobuf'))
27 extension = AMBuild.AddJob(name)
28 binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
29 SM.PreSetupHL2Job(extension, binary, i)
31 if i in ['csgo', 'dota']:
32 if AMBuild.target['platform'] == 'linux':
33 link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
34 target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'linux32', 'release'), 'libprotobuf.a')
38 extension.AddCommand(SymlinkCommand(link, target))
39 elif AMBuild.target['platform'] == 'darwin':
40 link = os.path.join(os.path.join(AMBuild.outputFolder, extension.workFolder), 'libprotobuf.a')
41 target = os.path.join(os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'osx32', 'release'), 'libprotobuf.a')
45 extension.AddCommand(SymlinkCommand(link, target))
46 elif AMBuild.target['platform'] == 'windows':
47 libPath = os.path.join(AMBuild.cache[sdk['sdk']], 'lib', 'win32', 'release', 'vs2010', 'libprotobuf.lib')
48 binary.RebuildIfNewer(libPath)
49 binary['POSTLINKFLAGS'].append(libPath)
53 'MenuStyle_Valve.cpp',
93 'MenuStyle_Radio.cpp',
99 if i in ['csgo', 'dota']:
100 files.append('smn_protobuf.cpp')
102 files.append('smn_bitbuffer.cpp')
104 binary.AddSourceFiles('core', files)
108 os.path.join('public', 'engine', 'protobuf', 'netmessages.pb.cc'),
109 os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
110 os.path.join('public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
112 binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
115 os.path.join('public', 'engine', 'protobuf', 'networkbasetypes.pb.cc'),
116 os.path.join('public', 'engine', 'protobuf', 'netmessages.pb.cc'),
117 os.path.join('public', 'game', 'shared', 'protobuf', 'ai_activity.pb.cc'),
118 os.path.join('public', 'game', 'shared', 'protobuf', 'usermessages.pb.cc'),
119 os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_commonmessages.pb.cc'),
120 os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessages.pb.cc'),
121 os.path.join('public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessage_helpers.cpp'),
123 binary.AddSourceFiles(AMBuild.cache[sdk['sdk']], files)
125 SM.PostSetupHL2Job(extension, binary, i)
127 if i in ['csgo', 'dota']:
128 if AMBuild.target['platform'] in ['linux', 'darwin']:
129 binary.AddObjectFiles(['libprotobuf.a'])
131 SM.AutoVersion('core', binary)
132 SM.ExtractDebugInfo(extension, binary)