diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-01 04:30:34 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-01 04:30:34 +0800 |
| commit | 81cf8b68eca2636574f3d0a9fa1cf0b428c163e9 (patch) | |
| tree | f3a83496e71358123cc5f838269dc134d02b63f6 /cmake/modules/RCCProjects.cmake | |
| parent | 72af0dedf9e18911da65b9a5c4906689e868d9fc (diff) | |
| download | rcc-project-81cf8b68eca2636574f3d0a9fa1cf0b428c163e9.tar.gz rcc-project-81cf8b68eca2636574f3d0a9fa1cf0b428c163e9.tar.xz | |
[Backend] Establish standalone build infrastructure
Add the thin monorepo CMake entry point and an independently configurable backend project. Enforce the Clang/C++23 toolchain, expose Make/Ninja-neutral tests and developer checks, export an installable RCCBackend package, and introduce the first Support error abstraction.
Diffstat (limited to 'cmake/modules/RCCProjects.cmake')
| -rw-r--r-- | cmake/modules/RCCProjects.cmake | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cmake/modules/RCCProjects.cmake b/cmake/modules/RCCProjects.cmake new file mode 100644 index 0000000..59c4fc5 --- /dev/null +++ b/cmake/modules/RCCProjects.cmake @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +set(RCC_KNOWN_PROJECTS backend) +set(RCC_DEFAULT_PROJECTS backend) + +set( + RCC_ENABLE_PROJECTS + "${RCC_DEFAULT_PROJECTS}" + CACHE STRING + "Semicolon-separated RCC projects to build, or 'all'" +) + +function(rcc_add_enabled_projects RCCSourceRoot) + if(RCC_ENABLE_PROJECTS STREQUAL "all") + set(EnabledProjects ${RCC_KNOWN_PROJECTS}) + else() + set(EnabledProjects ${RCC_ENABLE_PROJECTS}) + endif() + + if(NOT EnabledProjects) + message(FATAL_ERROR "RCC_ENABLE_PROJECTS must name at least one project") + endif() + + list(REMOVE_DUPLICATES EnabledProjects) + + foreach(Project IN LISTS EnabledProjects) + if(NOT Project IN_LIST RCC_KNOWN_PROJECTS) + message( + FATAL_ERROR + "Unknown RCC project '${Project}'. Known projects: ${RCC_KNOWN_PROJECTS}" + ) + endif() + endforeach() + + # Component order is controlled here rather than by the user-provided list. + # Future inter-project dependency closure will also be resolved here. + if("backend" IN_LIST EnabledProjects) + add_subdirectory("${RCCSourceRoot}/backend" "${CMAKE_BINARY_DIR}/backend") + endif() +endfunction() |
