Fix Haiku CI to build with Haiku subsystems enabled #12952
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the Haiku CI by making it properly compile targetting Haiku, so that all the Haiku platform-specific subsystems can be compiled in CI.
Description
A while back I was setting up CI to build an SDL game for Haiku and was using SDL's Haiku CI as a reference for cross compiling something for Haiku. It managed to produce a binary which appeared to run but did not do anything.
I later figured out that while it was building with the toolchain for Haiku, it still tries to use Linux system headers or something similar that ends in disappointment and compile errors. Passing
SDL_UNIX_CONSOLE_BUILD=ON
as the CI does makes it build but it disables most of the Haiku platform subsystems, for someone using the resulting library it essentially becomes headless, and for SDL's CI build coverage it excludes a lot of Haiku-specific code in SDL that may want to be tested such that it compiles.So I ended up writing a CMake toolchain file that can be used with the cross-compiler container to produce a functional Haiku binary for the game, which I assume might be of use for SDL's Haiku CI too.
Existing Issue(s)
N/A
I ended up hardcoding the location to the toolchain file based on where it's located in the Actions runner because I was unsure how to point to it in a stable way - just putting
build-scripts/...
breaks it when trying to test the CMake configuration. I assume @madebr would maybe have some advice on how to get that fixed, so putting this as a draft right now.