diff --git a/recipes/gsl-lite/all/conanfile.py b/recipes/gsl-lite/all/conanfile.py index 32aaedef0f8b9..f15301e8ae492 100644 --- a/recipes/gsl-lite/all/conanfile.py +++ b/recipes/gsl-lite/all/conanfile.py @@ -1,7 +1,8 @@ +import os + from conan import ConanFile -from conan.tools.files import get, copy +from conan.tools.files import copy, get from conan.tools.layout import basic_layout -import os required_conan_version = ">=1.50.0" @@ -23,11 +24,12 @@ class GslLiteConan(ConanFile): # 2. GSL_THROW_ON_CONTRACT_VIOLATION: a gsl::fail_fast exception will be thrown # 3. GSL_UNENFORCED_ON_CONTRACT_VIOLATION: nothing happens # - options = { - "on_contract_violation": ["terminate", "throw", "unenforced", "None"] - } + options = {"on_contract_violation": [None, "terminate", "throw", "unenforced"]} default_options = { - "on_contract_violation": "terminate", + "on_contract_violation": None, + } + options_description = { + "on_contract_violation": "Select the behavior when pre/post conditions on the GSL types are violated" } no_copy_source = True @@ -59,7 +61,7 @@ def package_info(self): self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] # TODO: back to global scope in conan v2 once cmake_find_package* generators removed - if self.options.on_contract_violation != "None": + if self.options.on_contract_violation: self.cpp_info.components["gsllite"].defines = [self._contract_map[str(self.options.on_contract_violation)]] # TODO: to remove in conan v2 once cmake_find_package* generators removed