open-source-parsers / jsoncpp

A C++ library for interacting with JSON.
Other
8.18k stars 2.65k forks source link

Inconsistent package contents dependent on build system #1170

Open AMDmi3 opened 4 years ago

AMDmi3 commented 4 years ago

Describe the bug Using different build systems lead to different package contents:

This makes it much harder to use jsoncpp, as jsoncpp consumer may not rely on any inconsistent component present. For instance, a project which relies on CMake modules will fail to build on FreeBSD which uses meson to build jsoncpp.

To Reproduce Build, install with cmake and meson, compare produced files

Expected behavior Single build system, or consistent behavior with both build systems. At the very least, a way to build all components which consumers may requiered (cmake modules AND static library AND shared library).

gunchev commented 4 years ago

The only static/shared library problem with cmake can be solved by calling cmake two times and packaging the relevant files.

AMDmi3 commented 4 years ago

The only static/shared library problem with cmake can be solved by calling cmake two times and packaging the relevant files.

Not really, this is usually solved with two separate targets for static and shared library.

dota17 commented 4 years ago

All the cmake support is user-provided, not official. We actually use meson in Travis CI.

At the very least, a way to build all components which consumers may requiered (cmake modules AND static library AND shared library).

Welcome a PR.

dota17 commented 4 years ago

Related PR: #827

I found that before this PR, there are different targets for static and shared library. And the target names were not unique. Also, you could find these targets in 1.8.4 or 0.10.7.

Not really, this is usually solved with two separate targets for static and shared library.

Thus, if we want to change the targets, please consider the influences of #827. What is more, could we add OBJECT LIBRARY except static and shared library?