usbemani icon indicating copy to clipboard operation
usbemani copied to clipboard

Fix post-build file move on Windows

Open aixxe opened this issue 1 year ago • 1 comments

This is the only issue I encountered when building USBemani for my controller on Windows.

[7/7] Linking CXX executable community_aixxe_mini-4-optical.elf
FAILED: community_aixxe_mini-4-optical.elf 
cmd.exe /C "[...] && cd /D D:\usbemani\obj\community_aixxe_mini-4-optical && mv community_aixxe_mini-4-optical.* D:\usbemani/build/""
'mv' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.

This change uses the move command when the host system is Windows.

Unlike mv, it will print paths for each moved file by default:

[7/7] Linking CXX executable community_aixxe_mini-4-optical.elf
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.bin
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.dis
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.elf
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.elf.map
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.hex
D:\usbemani\obj\community_aixxe_mini-4-optical\community_aixxe_mini-4-optical.uf2
        6 file(s) moved.

Build finished

The > NUL at the end of the command supresses this, so it should be consistent with the behaviour on Linux/macOS.

[7/7] Linking CXX executable community_aixxe_mini-4-optical.elf

Build finished

aixxe avatar Nov 28 '23 15:11 aixxe

This will work, though I have a couple thoughts:

  • I need to double-check to see what's happening for the AVR builds as well. There's a good chance we would have a failure there as well.
  • Ideally, it might be worth making this part of the process that normally just delegates to CMake/DMBS/etc., rather than having the build process worry about it.

progmem avatar Nov 28 '23 16:11 progmem