# vim: set ts=2 sw=2 tw=99 noet ft=python: import os compiler = SM.DefaultExtCompiler('extensions/sqlite') compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) compiler['CDEFINES'].extend(['SQLITE_OMIT_LOAD_EXTENSION', 'SQLITE_THREADSAFE']) if AMBuild.target['platform'] == 'linux': compiler['POSTLINKFLAGS'].extend(['-ldl', '-lpthread']) extension = AMBuild.AddJob('dbi.sqlite.ext') binary = Cpp.LibraryBuilder('dbi.sqlite.ext', AMBuild, extension, compiler) files = [ 'sdk/smsdk_ext.cpp', 'sdk/sm_memtable.cpp', 'extension.cpp', 'driver/SqDatabase.cpp', 'driver/SqDriver.cpp', 'driver/SqQuery.cpp', 'driver/SqResults.cpp', 'sqlite-source/alter.c', 'sqlite-source/analyze.c', 'sqlite-source/attach.c', 'sqlite-source/auth.c', 'sqlite-source/btree.c', 'sqlite-source/build.c', 'sqlite-source/callback.c', 'sqlite-source/complete.c', 'sqlite-source/date.c', 'sqlite-source/delete.c', 'sqlite-source/expr.c', 'sqlite-source/func.c', 'sqlite-source/hash.c', 'sqlite-source/insert.c', 'sqlite-source/legacy.c', 'sqlite-source/main.c', 'sqlite-source/malloc.c', 'sqlite-source/opcodes.c', 'sqlite-source/os.c', 'sqlite-source/pager.c', 'sqlite-source/parse.c', 'sqlite-source/pragma.c', 'sqlite-source/prepare.c', 'sqlite-source/printf.c', 'sqlite-source/random.c', 'sqlite-source/select.c', 'sqlite-source/table.c', 'sqlite-source/tokenize.c', 'sqlite-source/trigger.c', 'sqlite-source/update.c', 'sqlite-source/utf.c', 'sqlite-source/util.c', 'sqlite-source/vacuum.c', 'sqlite-source/vdbe.c', 'sqlite-source/vdbeapi.c', 'sqlite-source/vdbeaux.c', 'sqlite-source/vdbeblob.c', 'sqlite-source/vdbefifo.c', 'sqlite-source/vdbemem.c', 'sqlite-source/vtab.c', 'sqlite-source/where.c', 'sqlite-source/btmutex.c', 'sqlite-source/journal.c', 'sqlite-source/mem1.c', 'sqlite-source/mem2.c', 'sqlite-source/mutex.c' ] if AMBuild.target['platform'] == 'windows': files.extend(['sqlite-source/mutex_w32.c', 'sqlite-source/os_win.c']) elif AMBuild.target['platform'] == 'linux' or AMBuild.target['platform'] == 'darwin': files.extend(['sqlite-source/mutex_unix.c', 'sqlite-source/os_unix.c']) binary.AddSourceFiles('extensions/sqlite', files) SM.AutoVersion('extensions/sqlite', binary) binary.SendToJob()