Conversation
f491050 to
b8f8d1d
Compare
| rm -fr DESTDIR-cmake | ||
| DESTDIR=$(pwd)/DESTDIR-cmake cmake --install build/ --config Release | ||
| ( cd DESTDIR-cmake; find ) | LC_ALL=C sort -u | ||
| find DESTDIR-cmake | LC_ALL=C sort -u |
There was a problem hiding this comment.
This was deliberate: I didn't want the DESTDIR-cmake common prefix generating extra noise when we list the installed files.
There was a problem hiding this comment.
Please revert this change in one of your (current) pr's.
The reason I did this was because I wrongly though it failed on Macos here.
There was a problem hiding this comment.
Will do. macOS might want ( cd ...; find . ) if its find(1) is less do-what-I-mean than Linux (I'm never sure what subset of the CLI is portable).
| mkdir DESTDIR-autotools | ||
| make -j"${parallel}" -C build-autotools install DESTDIR="${curdir}/DESTDIR-autotools" V=1 | ||
| ( cd DESTDIR-autotools; find ) | LC_ALL=C sort -u | ||
| find DESTDIR-autotools | LC_ALL=C sort -u |
I think so. The possible build configurations for a library (let's say libpng) are:
But if you're using the vendored libpng, then I don't think the two shared-linking options really make sense: you're paying the compile time and disk space cost of a copy of libpng anyway, whether it's shared (a separate file) or static (copied into the SDL_image library) . Having it as a shared library seems like it just brings more reasons why the overall system can fail, for instance conflicts with a system copy that happens to have the same SONAME. In particular, building your own vendored shared library for zlib seems like a recipe for disaster, because on Linux and macOS there are likely to be OS components that depend on the OS's zlib. If you release a game that includes SDL_image, then wait 5 years, the OS zlib will probably be newer than your bundled zlib, so other OS components will expect to find that newer version, and will crash if they find a vendored shared library instead. I like the way SDL_ttf handles this: if it's building a vendored Freetype or Harfbuzz, then the vendored copy is statically linked into the SDL_ttf library. This makes the SDL_ttf library larger than it would be when using an OS copy, but avoids conflicting with an older or newer system copy of Freetype or Harfbuzz. SDL_ttf also uses |
|
I'm not a maintainer, but: I think if there are things that are functionally necessary (like being able to enable JPEG and PNG saving), it might be good to carve those out into smaller PRs, which will be quicker to review and less likely to conflict with other parallel work like #242. Major refactoring and stylistic changes are basically guaranteed to conflict with everything else that touches the same files, so it's good to do those when the same files are otherwise quiet. |
When I've done this sort of refactor in other projects, the way I generally do it is to choose the piece of refactoring that I think is highest-priority or most likely to be accepted quickly, do that as its own PR, get it reviewed, choose the next-highest-priority, and repeat until everything I want has gone in. |
I haven't set it up for CMake yet (although it does work) because that would conflict pretty badly with libsdl-org#238. Signed-off-by: Simon McVittie <smcv@collabora.com>
I haven't set it up for CMake yet (although it does work) because that would conflict pretty badly with #238. Signed-off-by: Simon McVittie <smcv@collabora.com>
|
@madebr, I'd like to make an SDL_image release candidate soon. I think this is the only work outstanding before I can do that. Do you have an ETA of having everything settled and ready for public eyes? |
|
Is this a blocker for a SDL_image release candidate? At the moment the source code releases aren't going to include |
For SDL_ttf, using FreeType and HarfBuzz as static libraries makes sense because they are core pieces of the library functionality. For SDL_image and SDL_mixer, the codecs are all optional pieces that can be used, or not, depending on an application's needs. For pre-built binary redistributables like DLLs for Windows or Frameworks for macOS, I like distributing the dependencies as optional shared libraries that can be present or not, depending on the application they're shipped with. For building with Linux distributions, it makes sense to build in all supported codecs with dependencies on other codec libraries in the system. Distributions have often chosen to depend on those packages rather than have them be optional. For building with CMake, this could either be a developer building a custom library for their own needs, or a Linux distribution choosing to use cmake instead of autotools. In the former case, it probably makes sense to use vendored libraries linked statically and defaulting off. In the latter case, the distribution maintainers will set whatever flags makes sense for the distribution. For Android.mk, which is the build system most closely analogous to CMake, I've chosen to default external dependencies off, and include them as static libraries when they are enabled. I will probably do the same for SDL_mixer for the next release. |
Yes, I'd like the next SDL library releases to have the improved CMake support. |
OK, that makes sense. A game bundling your prebuilt SDL_image DLL, but only bundling a subset of your prebuilt dependency DLLs, is a use-case that I hadn't thought about (I'd assumed that everyone who vendors libraries would want to build their own, to have control over their supply chain).
Right, that's what I do in Debian - we have a lot of machinery for managing shared library dependencies and making sure incompatible combinations aren't possible, none of which works when using |
|
#246 sets up the vendored libraries to be built as static libraries if the |
25807ab to
ae50092
Compare
- Use 'SDL2IMAGE_' prefix for all options - Create SDL2_image::SDL2_image when building a shared library, create SDL2_image::SDL2_image-static when building a static library - Use same CMake layout as SDL_ttf/SDL_mixer - Create libSDL2_imaged.so symbolic link (when building debug build type) - Add PrivateSdlFunctions.cmake script for common functionality between SDL_XXX - Add FindXXX.cmake scripts for dependencies that don't provide one - Add CMakeLists.txt + cmake scripts to source distribution - Bring jpeg/png saving support to cmake - Update the git submodules - Test CMake on mingw64 (using system dependencies there) - Add MacOS CI - Create symbolic link at build time + install it - Add Macos versioning - Add single SDL2IMAGE_VENDORED option to enable vendoring of dependencies
This pr does the same. |
|
I'm going to mark this pr as finished so other work can be done on top of it. |
create SDL2_image::SDL2_image-static when building a static library
SDL2IMAGE_VENDOREDoption to use vendored libraries for everything, or none at all.I haven't added these scripts to
EXTRA_DISTinMakefile.amyet, to allow some maturing + extra tests.Need review on:
-DSDL2IMAGE_xxx=ON), the cmake script will complain loudly instead of silently ignoring the option.