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

Remove safe wildcard #3697

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all 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
14 changes: 14 additions & 0 deletions reference/conanfile/methods/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ recipe to remove them so they are not used in the recipe:
# No need to delete those settings here, they were already deleted
pass

For packages where you want to remove every subsetting of a setting, you can use the ``rm_safe`` method
with a wildcard:

.. code-block:: python

settings = "os", "compiler", "build_type", "arch"

def configure(self):
self.settings.rm_safe("compiler.*")


This will remove all the subsettings of the ``compiler`` setting, like ``compiler.libcxx`` or ``compiler.cppstd``,
but keep the ``compiler`` setting itself (Which ``self.settings.rm_safe("compiler")`` would remove).

Likewise, for a package containing a library, the ``fPIC`` option really only applies when the
library is compiled as a static library, but otherwise, the ``fPIC`` option doesn't make sense,
so it should be removed:
Expand Down