blob: 9bf0d688d88754fdaa27e0847dcf73e2dd2edd43 [file]
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:code_assets/code_assets.dart';
import 'package:hooks/hooks.dart';
import 'package:native_toolchain_c/native_toolchain_c.dart';
final builder = CBuilder.library(
name: 'sqlite3',
assetName: 'src/third_party/sqlite3.g.dart',
sources: ['third_party/sqlite/sqlite3.c'],
);
void main(List<String> args) async {
await build(args, (input, output) async {
if (input.config.buildCodeAssets) {
await builder.run(
input: input,
output: output,
defines: {
if (input.config.code.targetOS == OS.windows)
// Ensure symbols are exported in dll.
'SQLITE_API': '__declspec(dllexport)',
},
);
}
});
}