fix: fix Windows build.dart

This commit is contained in:
Nick Fisher
2025-07-17 10:54:00 +08:00
parent e169bf6c41
commit 437e91e7bd
4 changed files with 12 additions and 7 deletions

View File

@@ -14,6 +14,8 @@ This is a simplified, Flutter-only wrapper around the underlying 3D rendering AP
Follow the steps listed in [Getting Started](./getting_started) to configure your Flutter installation and project. Follow the steps listed in [Getting Started](./getting_started) to configure your Flutter installation and project.
If you're running Windows, delete the `examples/flutter/quickstart/assets` symlink and copy the `assets` folder from `examples/assets` to `examples/flutter/quickstart/assets`.
## Basic Usage ## Basic Usage
```dart ```dart

View File

@@ -131,7 +131,7 @@ void main(List<String> args) async {
var frameworks = []; var frameworks = [];
if (platform != "windows") { if (targetOS != OS.windows) {
flags.addAll(['-std=c++17']); flags.addAll(['-std=c++17']);
} else { } else {
defines["WIN32"] = "1"; defines["WIN32"] = "1";
@@ -194,7 +194,7 @@ void main(List<String> args) async {
name: packageName, name: packageName,
language: Language.cpp, language: Language.cpp,
assetName: 'thermion_dart.dart', assetName: 'thermion_dart.dart',
sources: platform == "windows" ? [] : sources, sources: targetOS == OS.windows ? [] : sources,
includes: platform == "windows" includes: platform == "windows"
? [] ? []
: ['native/include', 'native/include/filament'], : ['native/include', 'native/include/filament'],
@@ -220,12 +220,12 @@ void main(List<String> args) async {
"/I${path.join(pkgRootFilePath, "native", "include", "windows", "vulkan")}", "/I${path.join(pkgRootFilePath, "native", "include", "windows", "vulkan")}",
"@${srcs.uri.toFilePath(windows: true)}", "@${srcs.uri.toFilePath(windows: true)}",
// ...sources, // ...sources,
'/link', // '/link',
"/LIBPATH:$libDir", // "/LIBPATH:$libDir",
'/DLL', // '/DLL',
] ]
], ],
dartBuildFiles: ['hook/build.dart'], libraryDirectories: [libDir],
); );
await cbuilder.run( await cbuilder.run(

View File

@@ -25,7 +25,6 @@
#pragma comment(lib, "dracodec.lib") #pragma comment(lib, "dracodec.lib")
#pragma comment(lib, "ibl.lib") #pragma comment(lib, "ibl.lib")
#pragma comment(lib, "ktxreader.lib") #pragma comment(lib, "ktxreader.lib")
#pragma comment(lib, "png.lib")
#pragma comment(lib, "z.lib") #pragma comment(lib, "z.lib")
#pragma comment(lib, "stb.lib") #pragma comment(lib, "stb.lib")
#pragma comment(lib, "uberzlib.lib") #pragma comment(lib, "uberzlib.lib")

View File

@@ -1,5 +1,9 @@
#pragma once #pragma once
#ifdef _WIN32
#include "ThermionWin32.h"
#endif
#ifdef __cplusplus #ifdef __cplusplus
namespace thermion { namespace thermion {
extern "C" extern "C"