2013-12-30 23:50:56 +01:00
|
|
|
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
2009-08-30 09:46:56 +02:00
|
|
|
import os
|
|
|
|
|
2018-10-04 19:59:40 +02:00
|
|
|
if SM.mysql_root:
|
|
|
|
for arch in SM.archs:
|
|
|
|
binary = SM.ExtLibrary(builder, 'dbi.mysql.ext', arch)
|
|
|
|
binary.compiler.cxxincludes += [
|
|
|
|
os.path.join(SM.mysql_root[arch], 'include'),
|
|
|
|
os.path.join(SM.mms_root, 'core', 'sourcehook')
|
|
|
|
]
|
|
|
|
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
|
|
|
|
binary.compiler.cxxflags += ['-fno-rtti']
|
|
|
|
elif binary.compiler.family == 'msvc':
|
|
|
|
binary.compiler.cxxflags += ['/GR-']
|
2009-08-30 09:46:56 +02:00
|
|
|
|
2018-10-04 19:59:40 +02:00
|
|
|
if builder.target.platform == 'linux' or builder.target.platform == 'mac':
|
|
|
|
binary.compiler.postlink += [
|
|
|
|
os.path.join(SM.mysql_root[arch], 'lib', 'libmysqlclient_r.a'),
|
|
|
|
'-lz',
|
|
|
|
'-lpthread',
|
|
|
|
'-lm',
|
|
|
|
]
|
|
|
|
if builder.target.platform == 'linux':
|
|
|
|
binary.compiler.postlink += ['-lrt']
|
|
|
|
elif builder.target.platform == 'windows':
|
|
|
|
binary.compiler.defines += ['WIN32_LEAN_AND_MEAN']
|
|
|
|
binary.compiler.postlink += [
|
|
|
|
os.path.join(SM.mysql_root[arch], 'lib', 'mysqlclient.lib'),
|
|
|
|
'wsock32.lib'
|
|
|
|
]
|
2017-12-20 08:56:23 +01:00
|
|
|
|
2018-10-04 19:59:40 +02:00
|
|
|
binary.sources += [
|
|
|
|
'../../public/smsdk_ext.cpp',
|
|
|
|
'mysql/MyBasicResults.cpp',
|
|
|
|
'mysql/MyBoundResults.cpp',
|
|
|
|
'mysql/MyDatabase.cpp',
|
|
|
|
'mysql/MyDriver.cpp',
|
|
|
|
'mysql/MyStatement.cpp',
|
|
|
|
'extension.cpp'
|
|
|
|
]
|
|
|
|
|
|
|
|
if binary.compiler.family == 'msvc' and binary.compiler.version >= 1900:
|
|
|
|
binary.sources += [ 'msvc15hack.c' ]
|
|
|
|
binary.compiler.linkflags += ['legacy_stdio_definitions.lib', 'legacy_stdio_wide_specifiers.lib']
|
|
|
|
binary.compiler.defines += ['HAVE_STRUCT_TIMESPEC']
|
2016-08-18 20:20:37 +02:00
|
|
|
|
2018-10-04 19:59:40 +02:00
|
|
|
SM.extensions += [builder.Add(binary)]
|
2012-04-14 02:12:24 +02:00
|
|
|
|