Skip to content

Commit

Permalink
feat(cli): add windows check to not use xwin in windows os
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Apr 22, 2024
1 parent e9bd235 commit 8f38fe1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/commands/windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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}
""");
}
Expand Down

0 comments on commit 8f38fe1

Please sign in to comment.