-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
build: install .pc and .cmake files to share/ #3619
Conversation
As nlohmann_json is a header-only library, its pkg-config and cmake config files should be installed to `share/` (GNUInstallDirs' DATADIR), as `share/` is the canonical directory where architecture-independent files should be stored, while `lib/` is for architecture-dependent stuff (see the [FHS][]). Apart from being technically correct, installing to `share/` can help with cross-compiling, for example in Debian-based environments. If you're interested, I'd suggest reading this [thread][]. Related to nlohmann#1697 [FHS]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#usrshareArchitectureindependentData [thread]: marzer/tomlplusplus#165 (comment)
@uhoreg, as you're the maintainer of the nlohmann-json3 Debian package, would you like to share some comment? |
I don't know much about cross-compiling, so I can't say much about how it would affect that, but it does at least seem plausible that putting it in In general, |
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.
Looks good to me.
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.
Looks good to me.
Thanks for merging :) |
Thanks for opening the PR! |
- cmake/.pc files are now installed to share/ as arch-independant, cf nlohmann/json#3619 for the rationale from kn@: - set NO_BUILD as this is a header-only port - Defer building tests to do-test target - Drop NO_TEST, all tests succeed (except the 4 that try to reach network via git clone) all consumers (mtxclient, nheko and mkvtoolnix) build fine with it. should fix a warzone2100 build failure seen by tb@
As nlohmann_json is a header-only library, its pkg-config and cmake config files should be installed to
share/
(GNUInstallDirs' DATADIR), asshare/
is the canonical directory where architecture-independent files should be stored, whilelib/
is for architecture-dependent stuff (see the FHS).Apart from being technically correct, installing to
share/
can help with cross-compiling, for example in Debian-based environments. If you're interested, I'd suggest reading this thread.Related to #1697
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.