blob: 715e49d81d8956fee069437b0c7a9fa44ec4b399 [file] [log] [blame] [edit]
// 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';
void main(List<String> args) async {
await build(args, (input, output) async {
if (input.config.buildCodeAssets) {
final builder = CBuilder.library(
name: 'stb_image',
assetName: 'src/third_party/stb_image.g.dart',
sources: ['third_party/stb_image.c'],
defines: {
if (input.config.code.targetOS == OS.windows)
// Ensure symbols are exported in dll.
'STBIDEF': '__declspec(dllexport)',
},
);
await builder.run(input: input, output: output);
}
});
}