Compare commits
1 Commits
Temp
...
new-toolch
| Author | SHA1 | Date | |
|---|---|---|---|
|
a4acfeceee
|
5
CMakeLists.txt
Normal file
5
CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(BarinkOS LANGUAGES C CXX ASM)
|
||||
|
||||
add_subdirectory(CoreLib)
|
||||
add_subdirectory(Kernel)
|
||||
14
CoreLib/CMakeLists.txt
Normal file
14
CoreLib/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
project(CoreLib LANGUAGES CXX)
|
||||
|
||||
set(SOURCES
|
||||
ctype.cpp
|
||||
Memory.cpp
|
||||
Path.cpp
|
||||
Stack.cpp
|
||||
String.cpp
|
||||
StringView.cpp
|
||||
)
|
||||
|
||||
add_library(CoreLib STATIC ${SOURCES})
|
||||
|
||||
target_include_directories(CoreLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
13
kernel/CMakeLists.txt
Normal file
13
kernel/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
project(Kernel LANGUAGES C CXX ASM)
|
||||
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
boot.s
|
||||
)
|
||||
|
||||
add_executable(kernel.elf ${SOURCES})
|
||||
target_link_libraries(kernel.elf PRIVATE CoreLib)
|
||||
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/link.ld)
|
||||
target_link_options(kernel.elf PRIVATE "-T${LINKER_SCRIPT}")
|
||||
|
||||
17
toolchain-i686-elf.cmake
Normal file
17
toolchain-i686-elf.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
# toolchain-i686-elf.cmake
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
|
||||
# Point to your custom cross tools
|
||||
set(CMAKE_C_COMPILER /opt/cross/bin/i686-elf-gcc)
|
||||
set(CMAKE_CXX_COMPILER /opt/cross/bin/i686-elf-g++)
|
||||
set(CMAKE_ASM_COMPILER /opt/cross/bin/i686-elf-as)
|
||||
set(CMAKE_AR /opt/cross/bin/i686-elf-ar)
|
||||
set(CMAKE_RANLIB /opt/cross/bin/i686-elf-ranlib)
|
||||
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
|
||||
# Flags for freestanding OS development
|
||||
set(CMAKE_C_FLAGS "-ffreestanding -Og -ggdb -Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "-ffreestanding -Og -ggdb -Wall -Wextra")
|
||||
|
||||
Reference in New Issue
Block a user