meta: add build system
This commit is contained in:
1
arch/x86_64/Arch.cmake
Normal file
1
arch/x86_64/Arch.cmake
Normal file
@@ -0,0 +1 @@
|
||||
include(QEMU)
|
||||
14
arch/x86_64/Platform/Rosetta.cmake
Normal file
14
arch/x86_64/Platform/Rosetta.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
set(CMAKE_SYSTEM_NAME Rosetta)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
|
||||
|
||||
find_program(C_COMPILER x86_64-elf-gcc REQUIRED)
|
||||
find_program(CXX_COMPILER x86_64-elf-g++ REQUIRED)
|
||||
find_program(ASM_COMPILER x86_64-elf-as REQUIRED)
|
||||
|
||||
set(CMAKE_C_COMPILER ${C_COMPILER})
|
||||
set(CMAKE_CXX_COMPILER ${CXX_COMPILER})
|
||||
set(CMAKE_ASM_COMPILER ${ASM_COMPILER})
|
||||
|
||||
SET(CMAKE_C_FLAGS "-ffreestanding -nostdlib" CACHE STRING "" FORCE)
|
||||
5
arch/x86_64/QEMU.cmake
Normal file
5
arch/x86_64/QEMU.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
find_program(QEMU qemu-system-${TARGET_ARCH} REQUIRED)
|
||||
|
||||
add_custom_target(run-kernel
|
||||
COMMAND ${QEMU} -kernel $<TARGET_FILE:${kernel_name}>
|
||||
DEPENDS ${kernel_name} ${bsp_name})
|
||||
Reference in New Issue
Block a user