A few fixes and started working on docs.

This commit is contained in:
Stephan Menzel
2025-07-21 11:44:07 +02:00
parent 2b12ddd653
commit 4f88221983
13 changed files with 203 additions and 63 deletions
+15 -4
View File
@@ -3,6 +3,7 @@
# See attached file LICENSE for full details
import os
from enum import Enum
from pathlib import Path
from build_functions.build_utils import file_and_console_log, run_in_shell
@@ -11,7 +12,17 @@ import common.settings
from package.package_info import PackageInfo
def cmake_build_install(local_directory, package_info: PackageInfo, cmake_args: list[tuple[str, str]] = []):
class CMakeBuildType(Enum):
RELEASE = (1, "Release")
RELWITHDEBINFO = (2, "RelWithDebInfo")
DEBUG = (3, "Debug")
def __init__(self, num, label):
self._num = num
self.label = label
def cmake_build_install(local_directory, package_info: PackageInfo, cmake_args: list[tuple[str, str]] = [],
build_type: CMakeBuildType = CMakeBuildType.RELEASE) -> Path:
argstr = ""
# Create flags string out of args tuples
@@ -39,7 +50,7 @@ def cmake_build_install(local_directory, package_info: PackageInfo, cmake_args:
run_in_shell(f"cmake .. {common.settings.cmake_toolset} -DCMAKE_CONFIGURATION_TYPES:STRING=Release "
f"{argstr} -DCMAKE_INSTALL_PREFIX={install_prefix}")
run_in_shell(f'cmake --build . --config Release --target INSTALL --parallel {common.settings.num_cores}')
run_in_shell(f'cmake --build . --config {build_type.label} --target INSTALL --parallel {common.settings.num_cores}')
with open("built_and_installed.txt", "w") as lockfile:
lockfile.write(f"built release")
@@ -51,5 +62,5 @@ def cmake_build_install(local_directory, package_info: PackageInfo, cmake_args:
return install_prefix
def assemble_prefix_path(packages: list[PackageInfo]) -> str:
paths = [str(pkg.install_location()) for pkg in packages]
return ";".join(paths)
paths = [str(pkg.install_location().as_posix()) for pkg in packages]
return ";".join(paths)
+2 -3
View File
@@ -26,13 +26,11 @@ run_in_buildpipeline = "BUILD_ARTIFACTSTAGINGDIRECTORY" in os.environ
num_cores = 3 if run_in_buildpipeline else 6
if os.name == "posix":
cmake_config_flag = "CMAKE_BUILD_TYPE=Release"
cmake_toolset = ""
lib_wildcard = "*.a"
dll_wildcard = "*.so"
zlib_static_lib_name = "libz.a"
elif os.name == "nt": # Windows
cmake_config_flag = "CMAKE_CONFIGURATION_TYPES:STRING=Release"
cmake_toolset = "-T v143"
boost_toolset = "msvc-" + cmake_toolset[-3:-1] + "." + cmake_toolset[-1]
boost_bootstrap_toolset = "vc" + cmake_toolset[-3:-1] + cmake_toolset[-1]
@@ -53,7 +51,8 @@ cmake_global_flags = [
("CMAKE_CXX_STANDARD_REQUIRED:BOOL", "ON"),
("CMAKE_MSVC_RUNTIME_LIBRARY:STRING", "\"MultiThreadedDLL\""),
("CMAKE_POSITION_INDEPENDENT_CODE:BOOL", "ON"),
("CMAKE_BUILD_TYPE:STRING", "Release")
("CMAKE_CONFIGURATION_TYPES:STRING", "Release;RelWithDebInfo"),
# ("CMAKE_BUILD_TYPE:STRING", "Release")
]
def set_global_rebuild(new_rebuild: bool = False) -> None: