DepperDan/build_functions/build_fineftp.py

38 lines
1.3 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 package.package_info import get_package_info
def build_fineftp(prefix: Path | str, sbom: dict):
print_banner("Building fineftp")
package_info = get_package_info("fineftp")
package_info.add_to_sbom(sbom)
asio_install_path = package_info.dependency_path("asio")
# It only appears to depend on gtest when I enable tests, which I don't
# googletest_install_path = package_info.dependency_path(prefix, "googletest")
fineftp_cmake_args = [
("FINEFTP_SERVER_BUILD_SAMPLES:BOOL", "OFF"),
("FINEFTP_SERVER_BUILD_TESTS:BOOL", "OFF"),
("FINEFTP_SERVER_USE_BUILTIN_ASIO:BOOL", "OFF"),
("asio_INCLUDE_DIR:PATH", (asio_install_path / "include").as_posix()),
("asio_DIR:PATH", asio_install_path.as_posix()),
]
fineftp_dir = clone_git_tag(package_info, recursive=False)
install_dir = cmake_build_install(fineftp_dir, package_info, cmake_args=fineftp_cmake_args)
write_package_version_batch(package_info.version)
return install_dir