41 lines
1.4 KiB
Python
41 lines
1.4 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
|
|
import common.settings
|
|
from package.package_info import get_package_info
|
|
|
|
|
|
def build_eigen(prefix: Path | str, sbom: dict):
|
|
|
|
print_banner("Building Eigen")
|
|
|
|
package_info = get_package_info("eigen")
|
|
|
|
# Eigen's build system has weird bugs
|
|
# https://stackoverflow.com/questions/71876437/cmake-error-compiler-does-not-support-c11-when-configuring-eigen-with-visual
|
|
# which make it fail with anything but explicitly set C++11. Sad, really. It appears to be fixed in master
|
|
# but I can't switch to master for a medical device.
|
|
global cpp_standard
|
|
prev_cpp_standard = common.settings.cpp_standard
|
|
common.settings.cpp_standard = "11"
|
|
|
|
package_info.add_to_sbom(sbom)
|
|
|
|
eigen_cmake_args = [
|
|
("CMAKE_Fortran_COMPILER_NOT_FOUND:BOOL", "ON")
|
|
]
|
|
eigen_dir = clone_git_tag(package_info, recursive=False)
|
|
install_dir = cmake_build_install(eigen_dir, package_info, cmake_args=eigen_cmake_args)
|
|
write_package_version_batch(package_info.version)
|
|
|
|
common.settings.cpp_standard = prev_cpp_standard
|
|
|
|
return install_dir
|