DepperDan/build_functions/build_onetbb.py

33 lines
1.2 KiB
Python

# (c) 2025 by Stephan Menzel
# Licensed under the Apache License, Version 2.0.
# See attached file LICENSE for full details
from pathlib import Path
from build_functions.build_utils import print_banner
from common.azure import write_package_version_batch
from common.cmake import cmake_build_install
from common.git_helpers import clone_git_tag
from common.settings import temporarily_set_shared
from package.package_info import get_package_info
def build_onetbb(prefix: Path | str, sbom: dict):
print_banner("Building oneTBB")
package_info = get_package_info("onetbb")
package_info.add_to_sbom(sbom)
# While we build everything static, we cannot do that with oneTBB. They issue a very strong
# warning if we try. Since we have to live with a number of DLL's anyway (possibly Qt)
# I think we just have to take one for the team, considering how low level tbb is.
with temporarily_set_shared():
cmake_args = [
("TBB_TEST:BOOL", "OFF")
]
src_dir = clone_git_tag(package_info, recursive=False)
install_dir = cmake_build_install(src_dir, package_info, cmake_args=cmake_args)
write_package_version_batch(package_info.version)
return install_dir