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

ANY value in a list is required #2615

Merged
merged 2 commits into from Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions migrating_to_2.0/recipes.rst
Expand Up @@ -117,6 +117,9 @@ Settings
Options
-------

default_options
^^^^^^^^^^^^^^^

The definition of the ``default_options`` attribute has changed when referring to a dependency. It is related to the
:ref:`unified patterns in the command line<conan_v2_unified_arguments>`.

Expand All @@ -140,6 +143,31 @@ The definition of the ``default_options`` attribute has changed when referring t
default_options = {"pkg/*:some_option": "value"}


ANY special value
^^^^^^^^^^^^^^^^^

The special value ``ANY`` has to be declared in a list:

.. code-block:: python
:caption: **From:**

from conans import ConanFile

class Pkg(Conanfile):
options = {"opt": "ANY"}


.. code-block:: python
:caption: **To:**

from conan import ConanFile

class Pkg(Conanfile):
options = {"opt": ["ANY"]}




The layout() method
-------------------

Expand Down
6 changes: 3 additions & 3 deletions reference/conanfile/attributes.rst
Expand Up @@ -344,7 +344,7 @@ options that can take any value.
options = {
"shared": [True, False],
"option1": ["value1", "value2"],
"option2": "ANY",
"option2": ["ANY]",
"option3": [None, "value1", "value2"],
"option4": [True, False, "value"],
}
Expand Down Expand Up @@ -387,7 +387,7 @@ go over all of them for the example recipe ``mypkg`` defined above:
options = {
"shared": [True, False],
"option1": ["value1", "value2"],
"option2": "ANY",
"option2": ["ANY"],
}

def configure(self):
Expand Down Expand Up @@ -527,7 +527,7 @@ not define them. This attribute should be defined as a python dictionary:
...
options = {"build_tests": [True, False],
"option1": ["value1", "value2"],
"option2": "ANY"}
"option2": ["ANY"]}
default_options = {"build_tests": True,
"option1": "value1",
"option2": 42}
Expand Down
2 changes: 1 addition & 1 deletion systems_cross_building/cross_building.rst
Expand Up @@ -231,7 +231,7 @@ With previous attributes, a draft for a recipe that packages a cross compiler co
name = "my_compiler"

settings = "os", "arch", "compiler", "build_type"
options = {"target": "ANY"}
options = {"target": ["ANY"]}
default_options = {"shared": False, "target": None}

def validate(self):
Expand Down