Open icculus opened 8 months ago
Not a dumb idea at all. It ties to this issue with the satellite libraries. I remembered this old Phoronix article about llvm creating interface libraries and tried it on the SDL library.
llvm-ifs --input-format=ELF libSDL3.so.0 --output-ifs libSDL3.txt
generates this file.
I pruned all non-SDL symbols and ran the following command:
llvm-ifs --endianness=little --arch=x86_64 --bitwidth=64 --input-format=IFS libSDL3.pruned.txt --output-elf libSDL3_ifs.so
Compiling and linking a SDL test executable against this interface library results in a working executable:
gcc ../test/testutils.c ../test/testsprite.c -I ../include libSDL3_test.a -lunwind libSDL3_ifs.so -Wl,-rpath,$PWD
The only issue with the interface library is that:
This might be a completely stupid idea (and maybe I said it before?), but I was thinking:
For projects that just want to make sure they build on GitHub Actions and don't care beyond that, we could maybe do this:
The benefit is that building SDL from scratch is (presumably) significantly faster and doesn't need any special configuration beyond access to a C compiler, and doesn't need extra tools and dependencies installed. The downside is obviously this won't actually function as a library if the project wants to run tests or whatnot, so this would have to be an option and not the default.
The source code to compile might look as simple as:
...is this a terrible idea?