From 07b262c841390ef6e65a8189b91a4bf020e8fb96 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 28 Nov 2020 14:51:42 +0100 Subject: [PATCH] Add defines for all 3 db backends. --- database/mysql/detect.py | 3 +++ database/postgres/detect.py | 2 ++ database/sqlite/detect.py | 2 ++ 3 files changed, 7 insertions(+) diff --git a/database/mysql/detect.py b/database/mysql/detect.py index 74c5054..980519f 100644 --- a/database/mysql/detect.py +++ b/database/mysql/detect.py @@ -58,11 +58,14 @@ def configure(env): if not mariadb_error: env.ParseConfig("pkg-config mariadb --cflags --libs") + env.Append(CPPDEFINES=["MYSQL_PRESENT"]) return if not mysql_error: env.ParseConfig("pkg-config mysql --cflags --libs") + env.Append(CPPDEFINES=["MYSQL_PRESENT"]) + # Link those statically for portability #if env["use_static_cpp"]: #env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"]) diff --git a/database/postgres/detect.py b/database/postgres/detect.py index 27700be..939ba73 100644 --- a/database/postgres/detect.py +++ b/database/postgres/detect.py @@ -47,6 +47,8 @@ def get_flags(): def configure(env): env.ParseConfig("pkg-config libpq --cflags --libs") + + env.Append(CPPDEFINES=["PGSQL_PRESENT"]) # Link those statically for portability #if env["use_static_cpp"]: diff --git a/database/sqlite/detect.py b/database/sqlite/detect.py index 5bdd2bb..c289b3b 100644 --- a/database/sqlite/detect.py +++ b/database/sqlite/detect.py @@ -48,6 +48,8 @@ def get_flags(): def configure(env): env.ParseConfig("pkg-config sqlite3 --cflags --libs") + env.Append(CPPDEFINES=["SQLITE_PRESENT"]) + # Link those statically for portability #if env["use_static_cpp"]: #env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])