From 8f38fe1e1fdb4fbb77abd255eb717e482897a73d Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Mon, 22 Apr 2024 20:43:07 +0600 Subject: [PATCH] feat(cli): add windows check to not use xwin in windows os --- cli/commands/windows.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/commands/windows.dart b/cli/commands/windows.dart index 01da0ad..c3f8789 100644 --- a/cli/commands/windows.dart +++ b/cli/commands/windows.dart @@ -37,7 +37,9 @@ class WindowsBuildCommand extends Command with BuildConfig { workingDirectory: buildDir, ); - await shell.run("cargo install cargo-xwin"); + if (!Platform.isWindows) { + await shell.run("cargo install cargo-xwin"); + } final libname = "$project.dll"; @@ -49,7 +51,7 @@ class WindowsBuildCommand extends Command with BuildConfig { final archDir = Directory(join(buildDir, arch))..create(recursive: true); await shell.run(""" rustup target add $target - cargo xwin build --target=$target -r --manifest-path ${join(projectDir, "Cargo.toml")} + cargo ${Platform.isWindows ? "" : "xwin"} build --target=$target -r --manifest-path ${join(projectDir, "Cargo.toml")} cp ${join(projectDir, "target", target, "release", libname)} ${archDir.path} """); }