meta: replace cmake mono-build system with a custom build co-ordinator
every system component now has its own self-contained build system, and a seed file describing the component and its build system and dependencies. a new tool, meadow, collects and uses these seed files to build the components into a full system. meadow also manages the target system root and a host prefix where toolchain tools are installed to. the build system has also been updated to use a new $ARCH-rosetta-gcc compiler, and the patches files necessary to build it have been added to toolchain/cross-compiler.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
if (LIBC_STANDALONE)
|
||||
cmake_minimum_required(VERSION 3.31)
|
||||
project(libc-core C ASM)
|
||||
endif ()
|
||||
|
||||
set(source_dirs assert stdio stdlib string errno ctype wctype unistd)
|
||||
|
||||
foreach (dir ${source_dirs})
|
||||
@@ -12,18 +17,16 @@ file(GLOB sys_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sys/${CMAKE_SYSTEM_PROCESSOR}/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sys/${CMAKE_SYSTEM_PROCESSOR}/*.S)
|
||||
|
||||
set(component_sources ${sources} ${sys_sources} PARENT_SCOPE)
|
||||
set(component_headers ${headers} PARENT_SCOPE)
|
||||
|
||||
rosetta_add_library(STATIC
|
||||
NAME libc-core
|
||||
PUBLIC_INCLUDE_DIRS ${public_include_dirs}
|
||||
SOURCES ${sources} ${sys_sources}
|
||||
HEADERS ${headers})
|
||||
|
||||
sysroot_add_library(
|
||||
NAME libc-core
|
||||
HEADER_DIR /usr/include
|
||||
LIB_DIR /usr/lib)
|
||||
if (NOT LIBC_STANDALONE)
|
||||
set(component_sources ${sources} ${sys_sources} PARENT_SCOPE)
|
||||
set(component_headers ${headers} PARENT_SCOPE)
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
add_library(libc-core STATIC ${sources} ${sys_sources} ${headers})
|
||||
target_include_directories(libc-core PUBLIC ${public_include_dirs})
|
||||
target_link_libraries(libc-core PRIVATE libmagenta librosetta)
|
||||
target_compile_definitions(libc-core PRIVATE ENABLE_GLOBAL_HEAP=1 BUILD_STATIC=1)
|
||||
set_target_properties(libc-core PROPERTIES
|
||||
PREFIX "")
|
||||
install(TARGETS libc-core)
|
||||
|
||||
Reference in New Issue
Block a user