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

[PkgConfigDeps][MesonToolchain] Added build context folder mechanism #3640

Merged
merged 6 commits into from
Mar 20, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions reference/tools/gnu/pkgconfigdeps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ you can activate it using the **build_context_activated** attribute:
build_context_suffix
^^^^^^^^^^^^^^^^^^^^

*DEPRECATED: use build_context_folder attribute instead*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true for autotools projects too? Or only for Meson? I think only Meson has the capability of specifying a folder for the build-requires?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MesonToolchain has the build.pkg_config_path variable, but I did not figure out how to do that in Autotools. Any ideas?


When you have the same package as a **build-require** and as a **regular require** it will
cause a conflict in the generator because the file names of the ``*.pc`` files will
collide as well as the names, requires names, etc.
Expand Down Expand Up @@ -139,6 +141,32 @@ renamed:
pc.generate()


build_context_folder
^^^^^^^^^^^^^^^^^^^^

*New since Conan 2.2.0*

Same concept as the quoted ``build_context_suffix`` attribute above, but this is meant to specify a folder to save
the `*.pc` files created by all those build requirements listed in the ``build_context_activated`` one:
franramirez688 marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: python

tool_requires = ["my_tool/0.0.1"]
requires = ["my_tool/0.0.1"]
def generate(self):
pc = PkgConfigDeps(self)
# generate the *.pc file for the tool require
pc.build_context_activated = ["my_tool"]
# save all the *.pc files coming from the "my_tool" build context and its requirements
pc.build_context_folder = "build" # [generators_folder]/build/
pc.generate()


.. important::

You cannot use this attribute along together with the already deprecated ``build_context_suffix`` one.


.. _PkgConfigDeps Properties:

Properties
Expand Down