Skip to content

Commit e4e2c68

Browse files
mattbajoreksimolus3
authored andcommitted
Link math for Android
1 parent 355ee98 commit e4e2c68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sqlite3_native_assets/lib/src/build.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ final class SqliteBuild {
6868
}
6969

7070
Future<void> _compile(String source) async {
71+
// Force-link libm on Android so C math symbols (e.g., trunc, log) resolve
72+
// at load time.
73+
final isAndroid = input.config.code.targetOS == OS.android;
74+
7175
final builder = CBuilder.library(
7276
name: 'sqlite3',
7377
assetName: 'sqlite3_native_assets.dart',
7478
sources: [source],
7579
defines: defines,
80+
libraries: [if (isAndroid) 'm'],
7681
);
7782

7883
if (trackSourcesAsDependencyForCompilation) {

0 commit comments

Comments
 (0)