Hello,
is it possible to cross compile a Tauri app with https://github.com/cross-rs/cross ?
To cross compile a binary crate I normally run CROSS_CONTAINER_ENGINE=podman cross build --release --target x86_64-pc-windows-gnu but this doesn't work in the context of a tauri app since it only compiles the backend
#Cross compiling with cross.rs
12 messages · Page 1 of 1 (latest)
Is your frontend platform-dependent?
No, I use Solid js
Then I don't understand the issue. You said the above command doesn't work since it only compiles the backend, but the backend is the only platform-specific part.
you can change tauri's runner directly: https://tauri.app/v1/api/config#buildconfig.runner. So if you set this to cross (instead of cargo) it should work the same as normally == beforeBuildCommand is executed and the paackages should be bundled too, depending on the target (most of the bundles can only be created on the target platform)
I added "runner": "cross" in my tauri.conf.json under the build configuration object and run CROSS_CONTAINER_ENGINE=podman cargo tauri build --target x86_64-pc-windows-gnu but it doesn't seem to run a container and just runs like it would without cross
I also get the same error as with a classic (without runner: cross) cargo tauri build --target x86_64-pc-windows-gnuwhich is linker x86_64-w64-mingw32-gcc not found
hmm, maybe it's not forwarding the target args. Can you try CROSS_CONTAINER_ENGINE=podman cargo tauri build --target x86_64-pc-windows-gnu -- --target x86_64-pc-windows-gnu? (first one for tauri, second one for the runner)
I get the same error as before
Also, if I remove CROSS_CONTAINER_ENGINE=podman, I don't get an error that I would normally get when running cross
This is my tauri.conf.json if it can help
don't know if it matters, but identifiers have dots, not dashes
I fixed it but it didn't solve the issue
Figures