Fixes and improvements: build with meson and versioning #85
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.
This pull request addresses several issues and improvements related to the meson build system and versioning. The following changes have been made:
Set project version in
meson.build
:The project version has been updated to '5.0' in the
meson.build
file. This adjustment allows dependent projects to specify the desired version of the microprofile dependency they intend to use. Previously, not setting the version would result in an error message like:Note: If the next upcoming release is not version 5.0, I can adjust the version accordingly before merging.
Export symbols:
In the previous build setup, symbols were not exported when building microprofile with meson. This pull request fixes the issue. Previously, the project relied on CMake's
GenerateExportHeader
to generate the export header file when building with CMake, while no such thing was done with meson. In this update, I've definedMICROPROFILE_API
in the microprofile main header file, along withMICROPROFILE_EXPORT
andMICROPROFILE_IMPORT
, to ensure proper symbol exporting. This change enables both CMake and meson to correctly defineMICROPROFILE_EXPORT_SYMBOLS
andMICROPROFILE_SHARED
macros when necessary;Improved subproject handling and
pkg-config
generation:The
meson.build
script now includes logic to detect whether the project is being used as a subproject. In case it is, this change prevents the installation of microprofile's headers and libraries. Additionally, the.pc
(pkg-config) file is now generated only when microprofile is not used as a subproject.However, I understand there may be some use cases when one may want to install microprofile, even when it's used as a subproject, so I'm open to discussing any potential extension/improvement.
EDIT: I decided it's probably better for the user to be able to choose if the library should be installed or not, so I've added a new option called
install
(set by default to false).Thank you for considering this pull request. Your feedback is highly appreciated, and I'm open to any further adjustments or modifications required for the seamless integration of these changes into the microprofile project.