pd-rs / crank

A wrapper for cargo to use creating games for the Playdate handheld gaming system.
MIT License
83 stars 16 forks source link

Better support for cross-compilation when neccesary #56

Open Clockwork757 opened 6 months ago

Clockwork757 commented 6 months ago

Crank doesn't recognize when cargo compiles to a target that doesn't match the host system. This is necessary on arm64 windows since the playdate simulator is only built for amd64 on windows.

My workaround is to build with cargo, copy the files to the default debug/release target and then execute crank run. For example:

cargo build --target x86_64-pc-windows-msvc
cp -fo .\target\x86_64-pc-windows-msvc\debug\* .\target\debug\
crank run

This works but it would be nice for crank to just work. I would also be down to implement this but I've had some trouble finding a simple way to determine the output folder or all the sources we'd need to check to determine it. Any guidance on that and I think this would be a pretty simple patch.

boozook commented 2 months ago

I've did it in other project cargo-playdate. I agree that there's no simple way to determine rustc-target, as well as cargo-target, so I'm using underlying cargo there.