Skip to content

Commit

Permalink
Update build files for SQLite and Unicode plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ethindp committed Oct 27, 2024
1 parent 388c8fe commit ed9302c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
20 changes: 14 additions & 6 deletions plugin/integrated/sqlite/_SConscript
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
Import("env")

scriptarray = env.SharedObject("scriptarray", "#ASAddon/plugin/scriptarray.cpp")
avxenv = env.Clone()
scriptarray = avxenv.SharedObject("scriptarray", "#ASAddon/plugin/scriptarray.cpp")
defines = ["SQLITE_CORE", "SQLITE_ENABLE_CARRAY=1", "SQLITE_ENABLE_CSV=1", "SQLITE_ENABLE_EXTFUNC=1", "SQLITE_ENABLE_FILEIO=1", "SQLITE_ENABLE_REGEXP=1", "SQLITE_ENABLE_SERIES=1", "SQLITE_ENABLE_SHA3=1", "SQLITE_ENABLE_UUID=1", "SQLITE_MAX_ATTACHED=125", "SQLITE_SECURE_DELETE=1", "SQLITE_USE_URI=1", "SQLITE_ENABLE_COMPRESS=1", "SQLITE_ENABLE_SQLAR=1", "SQLITE_ENABLE_ZIPFILE=1", "SQLITE3MC_USE_MINIZ=1", "SQLITE_DQS=0", "SQLITE_DEFAULT_MEMSTATUS=0", "SQLITE_DEFAULT_WAL_SYNCHRONOUS=1", "SQLITE_LIKE_DOESNT_MATCH_BLOBS", "SQLITE_MAX_EXPR_DEPTH=0", "SQLITE_OMIT_DEPRECATED", "SQLITE_USE_ALLOCA", "SQLITE_OMIT_AUTOINIT", "SQLITE_STRICT_SUBTYPE=1", "SQLITE_ALLOW_URI_AUTHORITY", "SQLITE_ENABLE_API_ARMOR", "SQLITE_ENABLE_BYTECODE_VTAB", "SQLITE_ENABLE_COLUMN_METADATA", "SQLITE_ENABLE_DBPAGE_VTAB", "SQLITE_ENABLE_DBSTAT_VTAB", "SQLITE_ENABLE_EXPLAIN_COMMENTS", "SQLITE_ENABLE_FTS3", "SQLITE_ENABLE_FTS3_PARENTHESIS", "SQLITE_ENABLE_FTS4", "SQLITE_ENABLE_FTS5", "SQLITE_ENABLE_GEOPOLY", "SQLITE_ENABLE_HIDDEN_COLUMNS", "SQLITE_ENABLE_MATH_FUNCTIONS", "SQLITE_ENABLE_JSON1", "SQLITE_ENABLE_MEMORY_MANAGEMENT", "SQLITE_ENABLE_MEMSYS5", "SQLITE_ENABLE_NORMALIZE", "SQLITE_ENABLE_NULL_TRIM", "SQLITE_ENABLE_PREUPDATE_HOOK", "SQLITE_ENABLE_RBU", "SQLITE_ENABLE_RTREE", "SQLITE_ENABLE_SESSION", "SQLITE_ENABLE_SNAPSHOT", "SQLITE_ENABLE_SORTER_REFERENCES", "SQLITE_ENABLE_STMTVTAB", "SQLITE_ENABLE_STAT4", "SQLITE_ENABLE_UPDATE_DELETE_LIMIT", "SQLITE_ENABLE_UNLOCK_NOTIFY", "SQLITE_SOUNDEX", "SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS", "SQLITE_MAX_LENGTH=2147483647"]
sqlite_addons = env.SharedObject(["dbdump.c", "eval.c", "monocypher.c", "monocypher-ed25519.c", "xchacha_cipher.c", "spellfix.c", "pack.cpp", "rng_get_bytes.c", "sqlite3.c"], CPPDEFINES = defines)
avxenv.Append(CPPPATH=["#extra/plugin/dep/sqlite3"])
if avxenv["PLATFORM"] == "win32":
avxenv.Append(CCFLAGS=["/arch:AVX"])
elif avxenv["PLATFORM"] == "darwin":
avxenv.Append(CCFLAGS=["-mneon"])
else:
avxenv.Append(CCFLAGS=["-mavx", "-maes"])
sqlite_addons = avxenv.SharedObject(["#extra/plugin/dep/sqlite3/dbdump.c", "#extra/plugin/dep/sqlite3/eval.c", "#extra/plugin/dep/sqlite3/monocypher.c", "#extra/plugin/dep/sqlite3/monocypher-ed25519.c", "#extra/plugin/dep/sqlite3/xchacha_cipher.c", "#extra/plugin/dep/sqlite3/spellfix.c", "pack.cpp", "#extra/plugin/dep/sqlite3/rng_get_bytes.c", "#extra/plugin/dep/sqlite3/sqlite3.c"], CPPDEFINES = defines)
if ARGUMENTS.get("no_shared_plugins", "0") == "0":
env.SharedLibrary("#release/lib/nvgt_sqlite", ["nvgt_sqlite.cpp", scriptarray, sqlite_addons], LIBS = ["PocoFoundationMT", "PocoDataSQLiteMT"] if env["PLATFORM"] == "win32" else ["PocoFoundation", "PocoDataSQLite"])
static = env.Object("nvgt_sqlite_static", "nvgt_sqlite.cpp", CPPDEFINES = [("NVGT_PLUGIN_STATIC", "nvgt_sqlite")])
static = env.StaticLibrary("#build/lib/nvgt_sqlite", [static, sqlite_addons])
static = [static, "PocoDataSQLiteMT" if env["PLATFORM"] == "win32" else "PocoDataSQLite"]
avxenv.SharedLibrary("#release/lib/nvgt_sqlite", ["nvgt_sqlite.cpp", scriptarray, sqlite_addons], LIBS = ["PocoFoundationMT", "PocoDataSQLiteMT"] if avxenv["PLATFORM"] == "win32" else ["PocoFoundation", "PocoDataSQLite"])
static = avxenv.Object("nvgt_sqlite_static", "nvgt_sqlite.cpp", CPPDEFINES = [("NVGT_PLUGIN_STATIC", "nvgt_sqlite")])
static = avxenv.StaticLibrary("#build/lib/nvgt_sqlite", [static, sqlite_addons])
static = [static, "PocoDataSQLiteMT" if avxenv["PLATFORM"] == "win32" else "PocoDataSQLite"]
Return("static")
5 changes: 3 additions & 2 deletions plugin/integrated/unicode/_SConscript
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Import("env")

scriptarray = env.SharedObject("scriptarray", "#ASAddon/plugin/scriptarray.cpp")
env.Append(CPPPATH=["#extra/plugin/dep/uni_algo"])
if ARGUMENTS.get("no_shared_plugins", "0") == "0":
env.SharedLibrary("#release/lib/unicode", ["unicode.cpp", "unicode_algo_data.cpp", scriptarray], LIBS = [])
env.SharedLibrary("#release/lib/unicode", ["unicode.cpp", "#extra/plugin/dep/uni_algo/unicode_algo_data.cpp", scriptarray], LIBS = [])
unicode_obj = env.Object("unicode_static", "unicode.cpp", CPPDEFINES = [("NVGT_PLUGIN_STATIC", "unicode_plugin")])
data_obj = env.Object("data_static", "data.cpp", CPPDEFINES = [("NVGT_PLUGIN_STATIC", "unicode_plugin")])
data_obj = env.Object("data_static", "#extra/plugin/dep/uni_algo/uni_algo_data.cpp", CPPDEFINES = [("NVGT_PLUGIN_STATIC", "unicode_plugin")])
static = env.StaticLibrary("#build/lib/unicode", [unicode_obj, data_obj])
Return("static")

0 comments on commit ed9302c

Please sign in to comment.