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
GIMP plugin: Link against the shared library. #573
Conversation
Now that the plugin only uses the external libjxl API we can link against the shared library. This reduces the binary size from 3.9 MB to 49 KB (both after stripping) which is important from a distribution point of view.
@xiota FYI. |
I'd propose this to merge for v0.6, WDYT @veluca93 ? |
Can we get this and also #525 merged for v0.6? |
yup |
I think it would be beneficial to have an additional static build, like how the oneshot examples do. On platforms, like windows, installing the dlls is a pain, so it would be good for the plugin to just work. |
A static build for windows, dynamic linking for linux distros is probably the most convenient indeed. Can we do it like that? (make it platform-dependent what is done) |
If either |
That's part of the pain of dlls in windows. Just copying the dll next to the exe doesn't work in modern windows, at least my attempts failed. libjxl dlls also have lots of dependencies that I couldn't figure out how to resolve on windows. The oneshot examples build both dynamic and static versions. It would be nice for the plugin to do the same. Also, since the API is changing, it would allow users to continue to use the old binary until the plugin is updated. (I'm in favor of building the plugin dynamically, but think also having the static version is beneficial.) |
ok, I'll merge this. libjxl.dll depends on brotli, and probably nothing else since we link the shared lib against the static skcms. Does |
Last time I tried building on Windows was over a week ago, around when I wrote the msys and crossroad guides. There were libpng and half a dozen other dll dependencies. Trying to build with |
cjxl.exe and djxl.exe will depend on all those; but not jxl.dll. It is possible that |
Is that how the static oneshot binaries are built? |
The oneshot examples are not built statically as part of the libjxl project. There's an examples/CMakeLists.txt example project that show how would you include libjxl statically; but we don't include that file in libjxl project itself. That file is meant to demonstrate how to write a cmake-based project with pkg-config that uses libjxl both statically and with the shared library. We build that in one of the CI workflows to make sure that it works, but not as part of the libjxl cmake run. What we include is examples/examples.cmake which uses the internally-defined "jxl" and "jxl_threads" targets. If you pass |
Now that the plugin only uses the external libjxl API we can link against the shared library. This reduces the binary size from 3.9 MB to 49 KB (both after stripping) which is important from a distribution point of view. (cherry picked from commit 3246b05) (cherry picked from PR libjxl#573)
Now that the plugin only uses the external libjxl API we can link
against the shared library. This reduces the binary size from 3.9 MB to
49 KB (both after stripping) which is important from a distribution
point of view.