1 # vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
4 for sdk_name in SM.sdks:
5 sdk = SM.sdks[sdk_name]
6 binary_name = 'sourcemod.' + sdk.ext
8 binary = SM.HL2Library(builder, binary_name, sdk)
9 compiler = binary.compiler
11 if sdk.name is 'csgo':
12 # Protobuf 2.3 headers have some signed/unsigned compares. I believe that it's fixed in later versions, but Valve.
13 if compiler.cxx.behavior is 'gcc':
14 compiler.cflags += ['-Wno-sign-compare']
15 compiler.cxxincludes += [
16 os.path.join(sdk.path, 'common', 'protobuf-2.3.0', 'src'),
17 os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
18 os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf')
20 elif sdk.name is 'dota':
21 compiler.cxxincludes += [
22 os.path.join(sdk.path, 'common', 'protobuf-2.4.1', 'src'),
23 os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
24 os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf'),
25 os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf')
28 if builder.target_platform is 'linux':
29 compiler.postlink += ['-lpthread', '-lrt']
31 if sdk.name is 'csgo' or sdk.name is 'dota':
32 if builder.target_platform is 'linux':
33 lib_path = os.path.join(sdk.path, 'lib', 'linux32', 'release', 'libprotobuf.a')
34 elif builder.target_platform is 'mac':
35 lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a')
36 elif builder.target_platform is 'windows':
37 if 'DEBUG' in compiler.defines:
38 lib_path = os.path.join(sdk.path, 'lib', 'win32', 'debug', 'vs2010', 'libprotobuf.lib')
40 lib_path = os.path.join(sdk.path, 'lib', 'win32', 'release', 'vs2010', 'libprotobuf.lib')
41 compiler.linkflags.insert(0, binary.Dep(lib_path))
45 'MenuStyle_Valve.cpp',
81 'MenuStyle_Radio.cpp',
87 if sdk.name in ['csgo', 'dota']:
88 binary.sources += ['smn_protobuf.cpp']
90 binary.sources += ['smn_bitbuffer.cpp']
92 if sdk.name is 'csgo':
94 os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
95 os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
96 os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
98 elif sdk.name is 'dota':
100 os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'networkbasetypes.pb.cc'),
101 os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
102 os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf', 'ai_activity.pb.cc'),
103 os.path.join(sdk.path, 'public', 'game', 'shared', 'protobuf', 'usermessages.pb.cc'),
104 os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_commonmessages.pb.cc'),
105 os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessages.pb.cc'),
106 os.path.join(sdk.path, 'public', 'game', 'shared', 'dota', 'protobuf', 'dota_usermessage_helpers.cpp'),
109 SM.binaries += [builder.Add(binary)]