Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onetbb: don't require pkgconf when tbbbind is disabled #21316

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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