Kryczkal/cmake modularization 04 - #170
Conversation
…erties instead of source file flags
…andling and consolidating target properties
…s and update dependencies
… validation logic
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… file detection, and update .gitignore with common patterns
…gement and linking order
…et_link_libraries calls
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…or x86_64 and i386 architectures
… remove redundant properties
…ation and simplify CMake targets
…execution and improve argument handling
There was a problem hiding this comment.
Pull Request Overview
Refactors CMake build system by centralizing architecture-specific configuration through a new alkos_register_runtime_environment function, eliminating the previous approach of passing configuration data from arch-level CMake to top-level via target properties. Also consolidates linker flags into toolchain configuration files.
- Introduces
alkos_register_runtime_environmentfunction to replace property-based data flow - Moves common linker flags from individual CMakeLists.txt to toolchain configuration
- Creates architecture-specific build targets with proper aliases
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/install/run_alkos.bash | Adds validation for unimplemented --mount and --tests flags |
| scripts/actions/build_alkos.bash | Updates build script to pass build directory instead of nested path |
| alkos/toolchains/x86_64-conf.cmake | Centralizes linker flags in toolchain configuration |
| alkos/kernel/arch/x86_64/loader64/CMakeLists.txt | Removes duplicated linker flags now inherited from toolchain |
| alkos/kernel/arch/x86_64/loader32/CMakeLists.txt | Removes duplicated linker flags now inherited from toolchain |
| alkos/kernel/arch/x86_64/kernel/CMakeLists.txt | Removes duplicated linker flags and cleans up comments |
| alkos/kernel/arch/x86_64/CMakeLists.txt | Replaces property-based configuration with function call |
| alkos/kernel/CMakeLists.txt | Updates comments and removes unused comment lines |
| alkos/cmake/ValidationHelpers.cmake | Adds path existence validation helper function |
| alkos/cmake/RuntimeHelpers.cmake | Implements new runtime environment registration system |
| alkos/CMakeLists.txt | Replaces property-based system with function-based architecture registration |
| file(APPEND "${BASH_CONF_FILE}" "export CONF_KERNEL_MODULES=\"${KERNEL_MODULES_FORMATTED}\"\n") | ||
| file(APPEND "${BASH_CONF_FILE}" "export CONF_KERNEL_COMMANDS=\"${KERNEL_COMMANDS_FORMATTED}\"\n") | ||
| file(APPEND "${BASH_CONF_FILE}" "export CONF_BUILD_DIR=\"${CMAKE_BINARY_DIR}\"\n") | ||
| file(APPEND "${BASH_CONF_FILE}" "export CONF_TOOL_DIR=\"${TOOL_BINARIES_DIR}\"\n") |
There was a problem hiding this comment.
The variable TOOL_BINARIES_DIR is used but not defined in this function. This will likely result in an empty value being written to the config file, which could cause runtime failures.
| file(APPEND "${BASH_CONF_FILE}" "export CONF_TOOL_DIR=\"${TOOL_BINARIES_DIR}\"\n") | |
| file(APPEND "${BASH_CONF_FILE}" "export CONF_TOOL_DIR=\"${ARG_TOOL_BINARIES_DIR}\"\n") |
There was a problem hiding this comment.
Works anyway and worrying about it is part of the configuration refactor. Out of scope of this PR
# Summary Refactored the passing of a ton of arguments from arch to top level cmake using a function to register arch. This is cleaner because it makes abi explicit while removing any magic "data flows" from bottom cmake to top down. Also moved linker flags to .conf file, making targets inherit them instead of repeating for each exe. # Note The scripts are becomming a mess. I don't care. The scripts are next to be shot after cmake. #159 Prev --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Refactored the passing of a ton of arguments from arch to top level cmake
using a function to register arch. This is cleaner because it makes abi explicit while removing any magic "data flows" from bottom cmake to top down. Also moved linker flags to .conf file, making targets inherit them instead of repeating for each exe.
Note
The scripts are becomming a mess. I don't care. The scripts are next to be shot after cmake.
#159 Prev