Closed electroly closed 3 years ago
Hi, Brian! Happy new year.
Can you check whether the following change to examples/tvforms/CMakeLists.txt
fixes the issue?
+ if (NOT CMAKE_CROSSCOMPILING)
add_custom_command(TARGET genparts POST_BUILD COMMAND genparts WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_command(TARGET genphone POST_BUILD COMMAND genphone WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+ endif()
The genparts
and genphone
executables generate .f32
files that can be opened with the tvforms
application. I thought it would be useful to generate them during the build process so that tvforms
can be used out-of-the-box. This may not have been a good idea, but anyway, it seems certain that these executables won't run if the target system is different from the host system. So the change above should prevent them from executing.
Perhaps the best fix is for me to just do two tvision builds, one for Windows with TV_BUILD_EXAMPLES=OFF and one for Linux with TV_BUILD_EXAMPLES=ON.
This would make more sense, but if it makes build times longer, you should be able to keep doing it the same way as until now.
Cheers.
Confirmed. That patch works. Thanks!
Cool. Thanks for the report!
I'm using tvision commit f5c4c359001835eee9851c9675969a03785206b6 with a fresh install of Arch Linux and mingw-w64. I see that your CI is building for Windows successfully, so this seems to be an issue cross-compiling for Windows from Linux. The name of these executables (genphone, genparts) makes me think the build process is trying to run them after building them, meaning they should have been built for the build system (Linux) and not the host system (Windows).
In traditional configure scripts there's usually the ability to specify separate build and host systems for cross-compiling. Is there a way I can do this for tvision?
I have a similar issue with tvhc, which I need to run as part of my own build. My workaround was to use Wine to execute tvhc.exe, but it would be nicer if I could build tvhc for the build system instead of the host system. Perhaps the best fix is for me to just do two tvision builds, one for Windows with
TV_BUILD_EXAMPLES=OFF
and one for Linux withTV_BUILD_EXAMPLES=ON
. This would fix it all for me, but tvision would still be unable to cross-compile the tvforms example for anyone who wants to do that.