jiixyj / libebur128

A library implementing the EBU R128 loudness standard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Honor the BUILD_SHARED_LIBS correctly

ePirat opened this issue · comments

Currently there is no way to build libebur128 only static or only shared, instead of the expected way to do this by honoring the BUILD_SHARED_LIBS option, it seems to use the custom BUILD_STATIC_LIBS option which does not disable building the shared libraries when true though.

It would be great if BUILD_SHARED_LIBS would be honored as documented by CMake, so that it would be possible to build only static or only shard libraries.

Thanks for the report and the PR! This is for sure the right approach. So the ebur128_static target is dropped and if for some reason you want to have both shared/static version you have to create two builds, right? I know that BUILD_STATIC_LIBS is set by tooling such as Conan and other package managers, so with this PR the behavior should be more aligned with the expectations of users.

So the ebur128_static target is dropped and if for some reason you want to have both shared/static version you have to create two builds, right?

Yes, unfortunately CMake has no official way other than building twice if someone wants static and shared libs, as far as I can see.

The downside is that the custom BUILD_STATIC_LIBS is not honored, we could add handling for that and set BUILD_SHARED_LIBS based on it (and error out if both are set in a conflicting way).

It's fine if we remove the custom BUILD_STATIC_LIBS as long as we document it in the changelog. The less custom and more simple the build system the better 👍

Ok, should I add a commit to the PR that adds it to the README News section or somewhere else?

I would have created an entry when I do the release anyway, but feel free to do so!

Ok, I've added a commit to the PR with the addition.