Skip to content

Commit

Permalink
bear: ensure cppstd is set
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Dec 31, 2023
1 parent 08d3f26 commit c52b03f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions recipes/bear/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import get, copy, rm, rmdir
Expand Down Expand Up @@ -48,10 +48,11 @@ def requirements(self):
self.requires("nlohmann_json/3.11.3")

def build_requirements(self):
self.tool_requires("cmake/[>=3.28 <4]")
if self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.1.0")
self.tool_requires("grpc/<host_version>")
# Older version of CMake fails to build object libraries in the correct order
self.tool_requires("cmake/[>=3.20 <4]")

def package_id(self):
del self.info.settings.compiler
Expand All @@ -73,6 +74,8 @@ def source(self):

def generate(self):
tc = CMakeToolchain(self)
if not valid_min_cppstd(self, self._min_cppstd):
tc.variables["CMAKE_CXX_STANDARD"] = self._min_cppstd
tc.variables["ENABLE_UNIT_TESTS"] = False
tc.variables["ENABLE_FUNC_TESTS"] = False
tc.generate()
Expand Down

0 comments on commit c52b03f

Please sign in to comment.