1.1 --- a/extensions/sqlite/AMBuilder Sat Dec 28 08:42:50 2013 -0500
1.2 +++ b/extensions/sqlite/AMBuilder Mon Dec 30 17:50:56 2013 -0500
1.3 @@ -1,22 +1,28 @@
1.4 -# vim: set ts=2 sw=2 tw=99 noet ft=python:
1.5 +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
1.6 import os
1.7
1.8 -compiler = SM.DefaultExtCompiler('extensions/sqlite')
1.9 -compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
1.10 +binary = SM.ExtLibrary(builder, 'dbi.sqlite.ext')
1.11 +binary.compiler.cxxincludes += [
1.12 + os.path.join(SM.mms_root, 'core', 'sourcehook'),
1.13 +]
1.14
1.15 -compiler['CDEFINES'].extend(['SQLITE_OMIT_LOAD_EXTENSION', 'SQLITE_THREADSAFE'])
1.16 -if AMBuild.target['platform'] == 'linux':
1.17 - compiler['POSTLINKFLAGS'].extend(['-ldl', '-lpthread'])
1.18 +binary.compiler.defines += [
1.19 + 'SQLITE_OMIT_LOAD_EXTENSION',
1.20 + 'SQLITE_THREADSAFE'
1.21 +]
1.22 +if builder.target_platform is 'linux':
1.23 + binary.compiler.postlink += ['-ldl', '-lpthread']
1.24
1.25 -extension = AMBuild.AddJob('dbi.sqlite.ext')
1.26 -binary = Cpp.LibraryBuilder('dbi.sqlite.ext', AMBuild, extension, compiler)
1.27 -files = [
1.28 - 'sdk/smsdk_ext.cpp', 'sdk/sm_memtable.cpp', 'extension.cpp',
1.29 - 'driver/SqDatabase.cpp', 'driver/SqDriver.cpp', 'driver/SqQuery.cpp',
1.30 - 'driver/SqResults.cpp', 'sqlite-source/sqlite3.c'
1.31 - ]
1.32 -binary.AddSourceFiles('extensions/sqlite', files)
1.33 -SM.AutoVersion('extensions/sqlite', binary)
1.34 -SM.ExtractDebugInfo(extension, binary)
1.35 -binary.SendToJob()
1.36 +binary.sources += [
1.37 + 'sdk/smsdk_ext.cpp',
1.38 + 'sdk/sm_memtable.cpp',
1.39 + 'extension.cpp',
1.40 + 'driver/SqDatabase.cpp',
1.41 + 'driver/SqDriver.cpp',
1.42 + 'driver/SqQuery.cpp',
1.43 + 'driver/SqResults.cpp',
1.44 + 'sqlite-source/sqlite3.c'
1.45 +]
1.46
1.47 +SM.binaries += [builder.Add(binary)]
1.48 +