# (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_c_ares(prefix: Path, sbom: dict) -> Path: print_banner("Building C-Ares (gRPC Dependency)") package_info = get_package_info("c-ares") package_info.add_to_sbom(sbom) cares_cmake_args = [ ("BUILD_SHARED_LIBS:BOOL", "OFF"), ("CARES_BUILD_TESTS:BOOL", "OFF"), ("CARES_BUILD_CONTAINER_TESTS:BOOL", "OFF"), ("CARES_BUILD_TOOLS:BOOL", "OFF"), ("CARES_SHARED:BOOL", "OFF"), ("CARES_STATIC:BOOL", "ON"), ("CARES_STATIC_PIC:BOOL", "ON"), ("CARES_MSVC_STATIC_RUNTIME:BOOL", "OFF") ] cares_dir = clone_git_tag(package_info, recursive=False) install_dir = cmake_build_install(cares_dir, package_info, cmake_args=cares_cmake_args) write_package_version_batch(package_info.version) return install_dir