blob: 1ba260aaaebaca14ebb8300b20fecaf934370426 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
From 05ec421a2f72f4fd63702959d677e9a7ac538d80 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Fri, 10 Oct 2025 00:44:56 +0100
Subject: [PATCH 1/8] meson: convert SQLite version detection to compile-time
test
Use compile-time test instead of relying on testing the SQLite version
at runtime. This is done to make cross-compilation possible again.
---
meson.build | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/meson.build
+++ b/meson.build
@@ -175,14 +175,17 @@ if not sqlite_dep.found()
sqlite_dep = cc.find_library('sqlite3', required: true)
sqlite_version_check = '''#include <sqlite3.h>
int main(int argc, char **argv) {
- return (SQLITE_VERSION_NUMBER >= 3035000) ? 0 : 1;
+ #if SQLITE_VERSION_NUMBER < 3035000
+ #error "SQLite version >= 3.35.0 required"
+ #endif
+ return 0;
}
'''
- if cc.run(
+ if not cc.compiles(
sqlite_version_check,
name: 'sqlite version check',
dependencies: sqlite_dep,
- ).returncode() != 0
+ )
error('Sqlite version >= 3.35.0 requried')
endif
endif
|