-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[CMake] generate pkg-config flatbuffers.pc file #6455
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
Conversation
This commit enables CMake to generate a flatbuffers.pc file on install. pkg-config eases the utilization of software libraries by enabling the developers of a library to define how the library should be used. It can be used as a tool by build systems to find and manage dependencies, this is notably the default Meson behavior and optionally used by CMake.
|
You forgot to mention which os/platform(s) need this file, and to do what :) |
|
Oops :p. Strictly speaking this support is not needed by any platform, this is an improvement of the packaging/distribution of flatbuffers. Packages often contain pkg-config files in most Linux distros (examples below) and are used by build systems to externalize library retrieval and use. Personally I need pkg-config to find the flatbuffers C++ library to build my tools using Meson+Nix, which will enable me to deploy my tools on Linux and macOS. Here are debian packages of serialization libraries packaged with pkg-config files:
|
|
@vglavnyy opinion? Note that in the case of FlatBuffers (moreso than Protobuf) distributing it thru linux distro packages is not great, since FlatBuffers depends heavily on flatc & runtime & generated code coming from the same version (commit), and distro packages being more long-lived things this easily creates problems. Ensuring you build flatc yourself as part of your CMake build is less error prone for example. That said, not particularly for or against adding this file. |
|
@aardappel
Ubuntu 20.04 already has |
|
Ok, looks like we should just merge this and see :) |
|
This PR is now making our CI fail, because it generates different paths on different OSes: https://ci.appveyor.com/project/aardappel/flatbuffers/builds/38015947/job/9ne7publivh24q4p Maybe simply turn off generating of this file on Windows, or non-*nix? |
Probably the generated flatbuffers.pc should not be a part of repo.
|
I think the generated |
|
I also think that |
* [idl_parser] Add kTokenNumericConstant token
This commit adds the new token for correct parsing of signed numeric constants.
Before this expressions `-nan` or `-inf` were treated as kTokenStringConstant.
This was ambiguous if a real string field parsed.
For example, `{ "text_field" : -name }` was accepted by the parser as valid JSON object.
Related oss-fuzz issue: 6200301176619008
* Add additional positive tests fo 'inf' and 'nan' as identifiers
* Rebase to HEAD
* Move processing of signed constants to ParseSingleValue method.
* Add missed `--cpp-static-reflection` (#6324) to pass CI
* Remove `flatbuffers.pc` from repository to unblock CI (#6455).
Probably the generated flatbuffers.pc should not be a part of repo.
* Fix FieldIdentifierTest()
This PR enables CMake to generate a
flatbuffers.pcfile on install, so end users can find the flatbuffers library.pkg-config eases the utilization of software libraries by enabling the developers of a library to define how the library should be used.
It can be used as a tool by build systems to find and manage dependencies, this is notably the default Meson behavior and optionally used by CMake.
I Tested that the generated
flatbuffers.pcwas valid:cmake-3.14.5, then inspectingflatbuffers.pcmanually.