-
Notifications
You must be signed in to change notification settings - Fork 62
Improve deps handling in CMake, make possible to not use libs from deps folders, and to use deps folders on unsupported platforms when provided #1822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…not use libs from them - Add an option to not build and link against libraries from external_deps * Purposed to make possible to build on linux using system-provided SDL3 instead of the one in DEPS, in the rare case the system already provides SDL3. * Purposed to make possible to build on macos-arm64 using the macos-amd64 deps archive to find the NaCl runtime, relying on the system (example: brew) to find libraries. * Purposed to make possible to build on freebsd using the linux deps archive to find the NaCl runtime, relying on the system to find libraries. - Use the macos-amd64 deps on macos-arm64 only if the user didn't provide a macos-arm64 deps folder by himself. - Use the linux deps on freebsd only if the user didn't provide a freebsd deps folder by himself. - Use the deps folder if the user provided it by himself, even if we don't know yet about this system or architecture or we don't support that.
Do not set an empty -march= option when attempting to build on an unknown system. We only print a warning when attempting to build on an unknown system, so this should not expect it is never built for an unknown system.
The first commit is important as I guess some distros like Arch would want to update their AUR script to use the Arch-provided SDL3 instead of the on in the deps archive, that one we provide because SDL3 is to new and many stable releases didn't packaged it yet. It should also make easier for building on extra plaforms (not supported in unizip, but buildable, like macos-arm64 and freebsd). |
I don't get how the riscv support is supposed to serve as a demonstration for any of the other stuff in the PR. Given that you added it to the
Hmm, if I were the build script maintainer I would definitely prefer to only copy the desired components into the deps dir, instead of putting them in there but then relying on an option to hopefully not use the libs that were provided. For ARM Macs why don't we do it properly and add its platform to |
How about adding an option |
bd05945
to
cdbf8bc
Compare
I removed the riscv64 demonstration. That acted as a demonstration for:
I now have a much larger branch on my end with that riscv stuff, but also macos-arm64 build (probably ready to use) and WIP freebsd. This was enough for me to test that CMake code. My freebsd experiment was enough to verify that yes it was using the linux archive without the SDL3 libs if no freebsd deps is provided, but as soon as I provide a freebsd deps folder myself, it uses the provided deps folder. I assume that part would work as well for macos-arm64. Also it looks like that freebsd experiment validated that the option to not use libs from a deps dir, even when using that deps dir, is working, which would be useful for linux too (when wanting to enforce linking everything against the system). Now what's remaining in that branch is the CMake stuff for that deps detection and deps lib skip, plus the |
The packager can either run |
Flatpak doesn't allow download as part of the build process, so if Flatpak provides SDL3, we better use the option to skip the libs, as we download the deps archive before the build already. |
I added some logging so it's now reporting what deps folder it is using, and it reports if it uses libs from the deps folder or not. |
6a6fbe7
to
5320285
Compare
With
With
So the |
I merge this for the release. |
Improve deps handling in CMake
cmake: use extra external deps if the directory exist and add an option to not use libs from them
macos-arm64
using themacos-amd64
deps archive to find the NaCl runtime, relying on the system (example: brew) to find libraries.freebsd
using thelinux
deps archive to find the NaCl runtime, relying on the system to find libraries.macos-amd64
deps onmacos-arm64
only if the user didn't provide amacos-arm64
deps folder by himself.linux
deps onfreebsd
only if the user didn't provide a freebsd deps folder by himself.cmake: only set -march if the architecture is known
Do not set an empty -march= option when attempting to build on an unknown system.
We only print a warning when attempting to build on an unknown system, so this should not expect it is never built for an unknown system.