Skip to content

Commit

Permalink
(#21316) onetbb: don't require pkgconf when tbbbind is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm authored Nov 23, 2023
1 parent 13b0b66 commit 2da1b80
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions recipes/onetbb/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import cross_building
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, load, rmdir
from conan.tools.gnu import PkgConfigDeps
from conan.tools.scm import Version
Expand Down Expand Up @@ -97,13 +98,17 @@ def validate(self):
raise ConanInvalidConfiguration(f"{self.ref} requires hwloc:shared=True to be built.")

def build_requirements(self):
if not self._tbbbind_explicit_hwloc and not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.0.3")
if self._tbbbind_build and not self._tbbbind_explicit_hwloc:
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.0.3")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
env = VirtualBuildEnv(self)
env.generate()

toolchain = CMakeToolchain(self)
toolchain.variables["TBB_TEST"] = False
toolchain.variables["TBB_STRICT"] = False
Expand All @@ -126,7 +131,7 @@ def generate(self):
os.path.join(hwloc_package_folder, "bin", "hwloc.dll").replace("\\", "/")
toolchain.generate()

if self._tbbbind_build:
if self._tbbbind_build and not self._tbbbind_explicit_hwloc:
deps = PkgConfigDeps(self)
deps.generate()

Expand Down

0 comments on commit 2da1b80

Please sign in to comment.