From 991c0845b18b09711174c3f00f4d5ad0354dfa1f Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 9 Aug 2021 20:00:32 +0300 Subject: [PATCH] tools.check_min_cppstd: add warning about API usage It requires to check the `cppstd` setting, as sometimes this setting could absent and the api call doesn't check it. --- reference/tools.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/tools.rst b/reference/tools.rst index 4337d194fb8c..9c61377b6f8a 100644 --- a/reference/tools.rst +++ b/reference/tools.rst @@ -1753,7 +1753,8 @@ It raises a ``ConanInvalidConfiguration`` when is not supported. ... def configure(self): - tools.check_min_cppstd(self, "17") + if self.settings.compiler.get_safe("cppstd"): + tools.check_min_cppstd(self, "17") * If the current cppstd does not support C++17, ``check_min_cppstd`` will raise an ``ConanInvalidConfiguration`` error. * If ``gnu_extensions`` is True, it is required that the applied ``cppstd`` supports the gnu extensions. @@ -1765,6 +1766,12 @@ Parameters: - **cppstd** (Required): C++ standard version which must be supported. - **gnu_extensions** (Optional): GNU extension is required. +.. warning:: + + All calls to ``tools.check_min_cppstd`` must be guarded by a check for the setting ``cppstd`` as this setting could absent + in some cases. See `the Conan-Center's FAQ for more details`. + + .. _tools.valid_min_cppstd: tools.valid_min_cppstd()