-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Bring Meson build definition more in line with CMake #4452
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
Open
dcbaker
wants to merge
9
commits into
nlohmann:develop
Choose a base branch
from
dcbaker:submit/meson-updates
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7188a4a
meson: Indent code inside an if block
dcbaker 8c74ccd
meson: set a minimum Meson version
dcbaker 42f30ff
meson: use `override_dependency()` to set dependencies
dcbaker 00e48e8
meson: use `install_subdir` for headers
dcbaker 76d91cd
meson: set the C++ standard to C++11
dcbaker da826f1
meson: handle single header and multiheader the same way CMake does
dcbaker 6664d32
meson: add support for the GlobalUDLs option
dcbaker 1836685
meson: add support for the ImplictConversions option
dcbaker 30c24bf
Add meson information to FILES.md
dcbaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| option( | ||
| 'MultipleHeaders', | ||
| type: 'boolean', | ||
| value: true, | ||
| description: 'Use non-amalgamated version of the library', | ||
| ) | ||
| option( | ||
| 'GlobalUDLs', | ||
| type: 'boolean', | ||
| value: true, | ||
| description: 'Place user-defined string literals in the global namespace', | ||
| ) | ||
| option( | ||
| 'ImplicitConversions', | ||
| type: 'boolean', | ||
| value: true, | ||
| description: 'Enable implicit conversions', | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There are more flags, see https://json.nlohmann.me/integration/cmake/#cmake-options for example. Though not are equally interesting, I wonder why here only theres three have been selected.
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.
It's been a while, I remember for sure that the
MultipleHeadersoption is essential to get the same behavior out of Meson and CMake, especially when using the Meson definitions in an embedded project. I don't remember why I added the other two.Uh oh!
There was an error while loading. Please reload this page.
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.
@nlohmann: I looked more, and I'm pretty sure that the reason that I added those two options in particular is that the related defines are exposed publicly in the pkg-config file. So for Meson and CMake to generate equivalent .pc files we'd need that.
Now that I'm looking at the generated CMake Target, it looks like JSON_DISABLE_ENUM_SERIALIZATION, JSON_DIAGNOSTICS, JSON_DIAGNOSTIC_POSITIONS, and JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON are exposed in CMake, so maybe we should update the pkg-config CMake generates to expose those as well?
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.
Sounds plausible, but I would not know how :)