fix!: Dart-only release mode builds on Window
This commit is contained in:
@@ -6,12 +6,11 @@ import 'package:native_toolchain_c/native_toolchain_c.dart';
|
|||||||
|
|
||||||
void main(List<String> args) async {
|
void main(List<String> args) async {
|
||||||
await build(args, (config, output) async {
|
await build(args, (config, output) async {
|
||||||
var logDir = Directory(
|
var logFile = File(
|
||||||
"${config.packageRoot.toFilePath()}.dart_tool/thermion_dart/log/");
|
"${config.packageRoot.toFilePath()}.dart_tool/thermion_dart/log/build.log");
|
||||||
if (!logDir.existsSync()) {
|
if (!logFile.parent.existsSync()) {
|
||||||
logDir.createSync(recursive: true);
|
logFile.parent.createSync(recursive: true);
|
||||||
}
|
}
|
||||||
var logFile = File(logDir.path + "/build.log");
|
|
||||||
|
|
||||||
final logger = Logger("")
|
final logger = Logger("")
|
||||||
..level = Level.ALL
|
..level = Level.ALL
|
||||||
@@ -22,6 +21,8 @@ void main(List<String> args) async {
|
|||||||
|
|
||||||
var platform = config.targetOS.toString().toLowerCase();
|
var platform = config.targetOS.toString().toLowerCase();
|
||||||
|
|
||||||
|
logger.info("Building Thermion for ${config.targetOS} in mode ${config.buildMode.name}");
|
||||||
|
|
||||||
// We don't support Linux (yet), so the native/Filament libraries won't be
|
// We don't support Linux (yet), so the native/Filament libraries won't be
|
||||||
// compiled/available. However, we still want to be able to run the Dart
|
// compiled/available. However, we still want to be able to run the Dart
|
||||||
// package itself on a Linux host(e.g. for dart_services backed), so if
|
// package itself on a Linux host(e.g. for dart_services backed), so if
|
||||||
@@ -110,11 +111,19 @@ void main(List<String> args) async {
|
|||||||
flags.addAll(['-std=c++17']);
|
flags.addAll(['-std=c++17']);
|
||||||
} else {
|
} else {
|
||||||
defines["WIN32"] = "1";
|
defines["WIN32"] = "1";
|
||||||
defines["_DEBUG"] = "1";
|
|
||||||
defines["_DLL"] = "1";
|
defines["_DLL"] = "1";
|
||||||
|
if(config.buildMode == BuildMode.debug) {
|
||||||
|
defines["_DEBUG"] = "1";
|
||||||
|
} else {
|
||||||
|
defines["RELEASE"] = "1";
|
||||||
|
defines["NDEBUG"] = "1";
|
||||||
|
}
|
||||||
flags.addAll([
|
flags.addAll([
|
||||||
"/std:c++20",
|
"/std:c++20",
|
||||||
|
if(config.buildMode == BuildMode.debug)
|
||||||
"/MDd",
|
"/MDd",
|
||||||
|
if(config.buildMode == BuildMode.release)
|
||||||
|
"/MD",
|
||||||
"/VERBOSE",
|
"/VERBOSE",
|
||||||
...defines.keys.map((k) => "/D$k=${defines[k]}").toList()
|
...defines.keys.map((k) => "/D$k=${defines[k]}").toList()
|
||||||
]);
|
]);
|
||||||
@@ -272,6 +281,8 @@ Future<Directory> getLibDir(BuildConfig config, Logger logger) async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info("Searching for Filament libraries under ${libDir.path}");
|
||||||
|
|
||||||
final url = _getLibraryUrl(platform, mode);
|
final url = _getLibraryUrl(platform, mode);
|
||||||
|
|
||||||
final filename = url.split("/").last;
|
final filename = url.split("/").last;
|
||||||
|
|||||||
Reference in New Issue
Block a user