-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
CMake misc fixes #943
CMake misc fixes #943
Conversation
36cf2c7
to
b175bae
Compare
@@ -142,7 +144,7 @@ endif() | |||
if (X265_FOUND AND NOT WITH_X265_PLUGIN) | |||
list(APPEND REQUIRES_PRIVATE "x265") | |||
endif() | |||
if ((AOM_DECODER_FOUND AND NOT WITH_AOM_DECODER_PLUGIN) OR (AOM_ENCODER_FOUND AND NOT WITH_AOM_ENCODER_PLUGIN)) | |||
if (AOM_FOUND AND NOT (WITH_AOM_DECODER_PLUGIN AND WITH_AOM_ENCODER_PLUGIN)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I now realize there was a special case for AOM_DECODER_FOUND
and AOM_ENCODER_FOUND
variables and if (${variableName}_FOUND)
above... However, that doesn't work for system supplied JPEG and OpenJPEG CMake find modules (hence the change to ${packageName}_FOUND
), so we now have a bit of a conflict to be solved somehow...
if (OpenJPEG_FOUND AND NOT WITH_OpenJPEG_PLUGIN) | ||
list(APPEND REQUIRES_PRIVATE "OpenJPEG") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@farindk This is the minimal snippet that is obviously incorrect and really needs to go in before the next release, the rest can wait to be fleshed out more...
I have rewritten the codec plugin configuration. The macro |
Thanks for reviewing them. |
@farindk There is still something perhaps a bit off w/ the plugin detection and configuration... W/ the default options (just
I have dav1d, svt-av1, rav1e, and openjpeg2 installed, so I'm expecting to see those as plugins? |
Also, you don't want to have |
These plugins are switched off by default. These additional codecs first have to be enabled, as for most users, they will just make the library larger without much benefit. |
I see. The the plugin option is ON by default for these, but you're saying it's gated by the first "enabled" option anyway? Perhaps the
Not really a possibility for distro packagers... |
There are usually two options for each codec. E.g. "WITH_DAV1D" and "WITH_DAV1D_PLUGIN". Thus, distributors that support separate plugins can enable all codecs and all I think I'll have to write this into the README. |
And/or into the CMakeLists.txt as well please. You can perhaps even express your intent explicitly in code as
Indeed, adding |
Thanks, I'll try that. BTW: you can also use |
Thanks, but ffmpeg brings a huge dependency chain w/ it (check out its list of required packages e.g. for MSYS2; other distros are probably similar...), so probably won't be enabling it just yet... |
I think this does not help much because the last parameter is only used when the cmake cache variable is not set yet. I.e. it does not create any constraint on the |
FWIW, the removal of Nevertheless, the change is probably correct as hardcoding the C++ runtime library isn't a good idea. It could also causes issues with (libjxl has a similar problem in this regard - libjxl/libjxl#1648) |
My GraphicsMagick build also failed after the |
@farindk We can try to bring back |
libvips resolved this via PR libvips/libvips#3715 instead. For autotools, you could use the |
Indeed, things work out automagically if using a C++ compiler/linker. However, I guess there is still the corner case of some apps that would use a C one through an older build system, where that custom macro would come in useful. @pszemus For example, GM hard codes '-lstdc++' also for libjxl, which is not exactly correct (see relevant libjxl line in https://sourceforge.net/p/graphicsmagick/code/ci/default/tree/configure.ac) and it look like they would need to sort this out eventually anyway (please feel free to report it there). Still, the question remains: libheif reverts to old behaviour (w/ correct C++ library) to help some apps, or insist on new one? |
Just for academic purposes, how can a library client (e.g. C application) that uses pkg-config to include dependencies, know if it should link the standard C++ library, other than through pkg-config .pc files? |
The library or application handles its own standard C/C++ library during its own build. There should be no need for anything higher in the food chain to know about that. Unless you're asking what if a pure C environment has no C++ installed, and suddenly needs one to satisfy the build dependency. I'm... not sure that's even possible in pkg-config, let alone cmake. I suppose there are scenarios where it must be, I've just never tried or seen it. |
"OpenJPEG" is redundant , and doesn't exist anyway as a pkgconf file.