DepperDan/build_functions/build_recycle.py

34 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
import shutil
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 package.package_info import get_package_info
def build_recycle(prefix: Path | str, sbom: dict):
print_banner("Building recycle")
package_info = get_package_info("recycle")
package_info.add_to_sbom(sbom)
cmake_args = [
("BUILD_TESTING", "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)
# Recycle doesn't have a CMake package file, even though a PR to that effect has been
# open for 3 years: https://github.com/steinwurf/recycle/pull/36
# I will use the same workaround as with asio and fake one myself
shutil.copy(Path(__file__).parent.parent / "patches" / "recycle" / "recycleConfig.cmake", install_dir)
return install_dir