'Build Tauri for all platforms on M1

Is there a way to build Windows and Linux versions of Tauri on my macbook pro m1? I already tried it with --target I just get an error while the build.

yarn run v1.22.15
$ tauri build -t x86_64-pc-windows-msvc
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.86
   Compiling libc v0.2.119
   Compiling cfg-if v1.0.0
   Compiling serde_derive v1.0.136
   Compiling serde v1.0.136
   Compiling ppv-lite86 v0.2.16
   Compiling siphasher v0.3.9
   Compiling getrandom v0.1.16
   Compiling winapi v0.3.9
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-pc-windows-msvc`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
Error running CLI: failed to build app: Result of `cargo build` operation was unsuccessful: exit status: 101
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


Solution 1:[1]

As of writing, Tarui is still in v1-rc so things may change.

According to the documents, to compile for all three os on a single machine is not supported, but can be done with VM's or Github Actions.

From the docs:

Cross-platform compilation is not supported at this moment. If you want to produce binaries for all three operating systems, you can use Virtual Machines or a CI service like GitHub Actions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bjbk