sourcemod/extensions/mysql/AMBuilder

39 lines
1.3 KiB
Plaintext
Raw Normal View History

2009-08-30 09:46:56 +02:00
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
compiler = SM.DefaultExtCompiler('extensions/mysql')
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['MYSQL5'], 'include'))
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
extension = AMBuild.AddJob('dbi.mysql.ext')
binary = Cpp.LibraryBuilder('dbi.mysql.ext', AMBuild, extension, compiler)
2010-05-11 10:46:55 +02:00
if AMBuild.target['platform'] == 'linux' or AMBuild.target['platform'] == 'darwin':
2009-08-30 09:46:56 +02:00
lib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'libmysqlclient_r.a')
link = [lib,
'-lz',
'-lpthread',
'-lm']
binary.RelinkIfNewer(lib)
binary['POSTLINKFLAGS'].extend(link)
elif AMBuild.target['platform'] == 'windows':
mylib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'mysqlclient.lib')
zlib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'zlib.lib')
binary.RelinkIfNewer(mylib)
binary.RelinkIfNewer(zlib)
binary['POSTLINKFLAGS'].extend([mylib, zlib, 'wsock32.lib'])
binary.AddSourceFiles('extensions/mysql', [
'sdk/smsdk_ext.cpp',
'mysql/MyBasicResults.cpp',
'mysql/MyBoundResults.cpp',
'mysql/MyDatabase.cpp',
'mysql/MyDriver.cpp',
'mysql/MyStatement.cpp',
'extension.cpp'
])
SM.AutoVersion('extensions/mysql', binary)
binary.SendToJob()