Add support for compiling MySQL ext against MySQL Connector/C instead of

full client lib. This makes for a lighter dependency, both in size and not being
tied to MySQL client version.

Tested against previous GA version, 6.0.2. Latest, 6.1.11 requires dynamic
linking with CRT on Windows, making specific MSVC redist required on client.

Only tested with Windows so far. Still need to test compile/run on Linux and Mac.
Dependency checkout scripts and MYSQL env vars in our own build environment need
to be checked as well.
This commit is contained in:
Nicholas Hastings 2018-02-25 12:38:19 -05:00
parent 0a91b1f5b1
commit f3319ccc82
2 changed files with 5 additions and 7 deletions

View File

@ -23,9 +23,9 @@ if SM.mysql_root:
if builder.target.platform == 'linux': if builder.target.platform == 'linux':
binary.compiler.postlink += ['-lrt'] binary.compiler.postlink += ['-lrt']
elif builder.target.platform == 'windows': elif builder.target.platform == 'windows':
binary.compiler.defines += ['WIN32_LEAN_AND_MEAN']
binary.compiler.postlink += [ binary.compiler.postlink += [
os.path.join(SM.mysql_root[arch], 'lib', 'opt', 'mysqlclient.lib'), os.path.join(SM.mysql_root[arch], 'lib', 'mysqlclient.lib'),
os.path.join(SM.mysql_root[arch], 'lib', 'opt', 'zlib.lib'),
'wsock32.lib' 'wsock32.lib'
] ]

View File

@ -36,14 +36,12 @@
#include <IDBDriver.h> #include <IDBDriver.h>
#include <sm_platform.h> #include <sm_platform.h>
#if defined PLATFORM_WINDOWS #if defined PLATFORM_WINDOWS
#include <winsock.h> #include <WinSock2.h>
#endif #endif
#include <mysql.h> #include <mysql.h>
#if !defined(PLATFORM_WINDOWS) #include <my_global.h>
# include <my_global.h> #include <my_sys.h>
# include <my_sys.h>
#endif
#include <sh_string.h> #include <sh_string.h>
#include <sh_list.h> #include <sh_list.h>