Skip to content

Commit

Permalink
ANY value in a list is required (#2615)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Jun 28, 2022
1 parent ff11162 commit 81f6fdd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
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

0 comments on commit 81f6fdd

Please sign in to comment.