D-YAML icon indicating copy to clipboard operation
D-YAML copied to clipboard

Meson build doesn't install static library

Open russel opened this issue 7 years ago • 5 comments

The Meson build for D-YAML installs the static library for tinyendian and the dynamic library for dyaml. Should the static library for tinyendian and static library for dyaml also be installed?

russel avatar May 16 '18 17:05 russel

@russel This is only due to the tinyendian Meson file explicitly stating that it wants a static library, hence a static library gets built and installed. Usually, you can toggle whether Meson builds shared libraries, static libraries or both by passing --default-library to it (with shared libs being the default). So, what actually should be done here is make tinyendian not enforce a static library build (it's a pretty trivial patch, I might submit that later today).

ximion avatar May 16 '18 23:05 ximion

@ximion I had sort of assumed that an installation (at least on Linux) should always install both static and dynamic libraries. This is what I have done for DInotify and Unit-Threaded.

russel avatar May 17 '18 10:05 russel

@russel No, the default is always to only install the shared libraries, at least on Linux distributions. In some rare cases, if it's considered useful to have, static libraries are installed as well, but that usually is the exception (unless of course the language does not support shared libraries ^^).

ximion avatar May 17 '18 13:05 ximion

Sounds like I should update the DInotify and Unit-Threaded builds then, so as to only produce the shared libraries.

russel avatar May 17 '18 14:05 russel

@russel That would only be necessary to conserve build time, I guess. Although on Linux, distributors would in any case make sure that their own packages only use the shared library version. I think what Meson does is the absolute best option to handle shared libraries: Making shared libs by default, but giving the user an option to easily toggle to using static libraries or both.

ximion avatar May 17 '18 17:05 ximion