2020-06-16 13:48:14 +02:00
|
|
|
Module {
|
|
|
|
|
property bool buildSharedLib: true
|
|
|
|
|
|
|
|
|
|
readonly property string libsDir: path + "/../../../src/libs"
|
|
|
|
|
readonly property string sqliteDir3rdParty: libsDir + "/3rdparty/sqlite"
|
|
|
|
|
readonly property string sqliteDir: libsDir + "/sqlite"
|
|
|
|
|
readonly property string includeDir: sqliteDir
|
|
|
|
|
|
|
|
|
|
Depends { name: "cpp" }
|
|
|
|
|
|
2021-05-07 14:33:01 +02:00
|
|
|
cpp.defines: {
|
2022-01-19 14:45:00 +01:00
|
|
|
var defines = ["SQLITE_CUSTOM_INCLUDE=config.h", "SQLITE_CORE"];
|
2021-05-07 14:33:01 +02:00
|
|
|
if (buildSharedLib)
|
|
|
|
|
defines.push("BUILD_SQLITE_LIBRARY");
|
|
|
|
|
else
|
|
|
|
|
defines.push("BUILD_SQLITE_STATIC_LIBRARY");
|
|
|
|
|
if (qbs.targetOS.contains("linux"))
|
|
|
|
|
defines.push("_POSIX_C_SOURCE=200809L", "_GNU_SOURCE");
|
|
|
|
|
else if (qbs.targetOS.contains("macos"))
|
|
|
|
|
defines.push("_BSD_SOURCE");
|
|
|
|
|
return defines;
|
|
|
|
|
}
|
2020-06-16 13:48:14 +02:00
|
|
|
|
|
|
|
|
cpp.dynamicLibraries: base.concat((qbs.targetOS.contains("unix") && !qbs.targetOS.contains("bsd"))
|
|
|
|
|
? ["dl", "pthread"] : [])
|
|
|
|
|
cpp.includePaths: base.concat([sqliteDir3rdParty, sqliteDir])
|
|
|
|
|
cpp.optimization: "fast"
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
name: "wrapper sources"
|
|
|
|
|
prefix: sqlite_sources.sqliteDir + '/'
|
|
|
|
|
files: [
|
|
|
|
|
"*.h",
|
|
|
|
|
"*.cpp"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
name: "sqlite sources"
|
|
|
|
|
prefix: sqlite_sources.sqliteDir3rdParty + '/'
|
|
|
|
|
cpp.warningLevel: "none"
|
|
|
|
|
files: [
|
2021-05-07 14:33:01 +02:00
|
|
|
"carray.c",
|
|
|
|
|
"config.h",
|
2020-06-16 13:48:14 +02:00
|
|
|
"sqlite3.c",
|
|
|
|
|
"sqlite3.h",
|
2021-05-07 14:33:01 +02:00
|
|
|
"sqlite.h",
|
2020-06-16 13:48:14 +02:00
|
|
|
"sqlite3ext.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|