build: update to support building under a hosted cross-compiler
This commit is contained in:
+2
-4
@@ -1,10 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.31)
|
cmake_minimum_required(VERSION 3.31)
|
||||||
project(magenta C ASM)
|
project(magenta C ASM)
|
||||||
|
|
||||||
if (NOT BUILD_TOOLS_DIR)
|
|
||||||
message(FATAL_ERROR "No build tools directory specified. Please run build.sh")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 17)
|
||||||
|
|
||||||
set(kernel_arch x86_64)
|
set(kernel_arch x86_64)
|
||||||
@@ -85,3 +81,5 @@ target_include_directories(magenta_debug PRIVATE
|
|||||||
libc/include
|
libc/include
|
||||||
libmagenta/include
|
libmagenta/include
|
||||||
arch/${kernel_arch}/include)
|
arch/${kernel_arch}/include)
|
||||||
|
|
||||||
|
install(TARGETS ${kernel_exe_name} DESTINATION boot)
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ file(GLOB sources *.c *.h include/magenta/debug/*.h)
|
|||||||
|
|
||||||
add_library(magenta_debug STATIC ${sources})
|
add_library(magenta_debug STATIC ${sources})
|
||||||
target_include_directories(magenta_debug PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
target_include_directories(magenta_debug PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
target_compile_options(magenta_debug PRIVATE -ffreestanding -nostdlib)
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
file(GLOB headers ${CMAKE_CURRENT_SOURCE_DIR}/include/magenta/*.h)
|
cmake_minimum_required(VERSION 3.31)
|
||||||
|
project(libmagenta C ASM)
|
||||||
|
|
||||||
|
file(GLOB headers
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include/magenta/*.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include-user/magenta/*.h)
|
||||||
file(GLOB asm_sources
|
file(GLOB asm_sources
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/*.S)
|
${CMAKE_CURRENT_SOURCE_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/*.S)
|
||||||
|
|
||||||
@@ -6,7 +11,14 @@ set(public_include_dirs
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include-user)
|
${CMAKE_CURRENT_SOURCE_DIR}/include-user)
|
||||||
|
|
||||||
add_library(libmagenta STATIC ${asm_sources})
|
add_library(libmagenta STATIC ${asm_sources} ${headers})
|
||||||
target_include_directories(libmagenta PUBLIC
|
target_include_directories(libmagenta PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include-user)
|
${CMAKE_CURRENT_SOURCE_DIR}/include-user)
|
||||||
|
target_compile_options(libmagenta PRIVATE -ffreestanding -nostdlib)
|
||||||
|
|
||||||
|
set_target_properties(libmagenta PROPERTIES
|
||||||
|
PREFIX "")
|
||||||
|
|
||||||
|
install(TARGETS libmagenta)
|
||||||
|
install(FILES ${headers} DESTINATION include/magenta)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
file(GLOB sources *.c *.h)
|
file(GLOB sources *.c *.h)
|
||||||
|
|
||||||
add_executable(e64patch ${sources})
|
add_executable(e64patch ${sources})
|
||||||
|
|
||||||
|
install(TARGETS e64patch)
|
||||||
|
|||||||
Reference in New Issue
Block a user