DepperDan/build_functions/build_cppzmq.py

30 lines
1010 B
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 package.package_info import get_package_info
def build_cppzmq(prefix: Path | str, sbom: dict):
print_banner("Building Lib cppzmq")
package_info = get_package_info("cppzmq")
package_info.add_to_sbom(sbom)
libzmq_install_path = package_info.dependency_path("libzmq")
cppzmq_cmake_args = [
("CPPZMQ_BUILD_TESTS:BOOL", "OFF"),
("ZeroMQ_DIR:PATH", str(libzmq_install_path / "CMake"))
]
cppzmq_dir = clone_git_tag(package_info, recursive=True)
install_dir = cmake_build_install(cppzmq_dir, package_info, cmake_args=cppzmq_cmake_args)
write_package_version_batch(package_info.version)
return install_dir