Made it easier to use the library with external zstdlib implementations.#228
Made it easier to use the library with external zstdlib implementations.#228ondys wants to merge 1 commit intoBinomialLLC:masterfrom
Conversation
…ns (mostly in non CMake builds). In our internal repository, we have our own version of zstdlib and introducing extra copy is both undesirable and potentially dangerous (due to ODR violations).
|
Yes I understand (and I figured this would be an issue with some users). After I fix a couple bugs I'll test and merge this in. |
|
Hmm - I need to think this change through a bit more and test it. However, I feel your pain here and will figure something out. |
|
This would ideally allow using a system copy as well for distributions, using e.g. find_package and pkg_find_module. |
|
I had to do a similar change in Godot, where we also use our own copy of zstd, and it can also be unbundled to link against system libraries on Linux: godotengine/godot#73441 The same change is needed in the transcoder, could you add it to this PR @ondys? Edit: I made #344 with this extra change so there's a merge-ready option. I'm happy to close it if this PR is updated with the transcoder fix. |
|
Just in case someone would find this useful, in Magnum I ended up solving this problem by creating the following filesystem hierarchy: The #ifndef this_is_not_the_real_zstd_h
#define this_is_not_the_real_zstd_h
#include <zstd.h>
#ifndef ZSTD_VERSION_MAJOR
#error expected to have a real zstd on the include path
#endif
#endif |
Mostly for non CMake builds.
In our internal repository, we have our own version of zstdlib and introducing extra copy is both undesirable and potentially dangerous (due to ODR violations). This allows us to ignore the added zstd/ folder and use our own version of the library.