From ff011a875c933556760e792faf360e4d9d9077b6 Mon Sep 17 00:00:00 2001 From: PerseoGI Date: Fri, 6 Sep 2024 10:37:20 +0200 Subject: [PATCH] on_contract_violation default None --- recipes/gsl-lite/all/conanfile.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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