31 lines
1001 B
Python
31 lines
1001 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_re2(prefix: Path | str, sbom: dict):
|
|
|
|
print_banner("Building re2")
|
|
|
|
package_info = get_package_info("re2")
|
|
package_info.add_to_sbom(sbom)
|
|
|
|
abseil_install_path = package_info.dependency_path("abseil-cpp")
|
|
|
|
re2_cmake_args = [
|
|
("RE2_BUILD_TESTING", "OFF"),
|
|
("absl_DIR:PATH", str(abseil_install_path / "lib" / "cmake" / "absl")),
|
|
]
|
|
re2_dir = clone_git_tag(package_info, recursive=False)
|
|
install_dir = cmake_build_install(re2_dir, package_info, cmake_args=re2_cmake_args)
|
|
write_package_version_batch(package_info.version)
|
|
return install_dir
|