Skip to content
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

Fixes and improvements: build with meson and versioning #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

romeoxbm
Copy link

@romeoxbm romeoxbm commented Aug 29, 2023

This pull request addresses several issues and improvements related to the meson build system and versioning. The following changes have been made:

  1. 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:

    Dependency microprofile found: NO found undefined but need: '5.0' (overridden)
    ERROR: Dependency 'microprofile' is required but not found.
    

    Note: If the next upcoming release is not version 5.0, I can adjust the version accordingly before merging.

  2. 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 defined MICROPROFILE_API in the microprofile main header file, along with MICROPROFILE_EXPORT and MICROPROFILE_IMPORT, to ensure proper symbol exporting. This change enables both CMake and meson to correctly define MICROPROFILE_EXPORT_SYMBOLS and MICROPROFILE_SHARED macros when necessary;

  3. 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.

- Updated project version in meson.build for better dependency management;
- Ensured proper symbol exporting for Meson builds by defining macros in the microprofile main header;
- Add install option to prevent unwanted installation and pkg-config file generation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant