Starting and testing cmake as a toolchain

This commit is contained in:
2025-12-02 17:22:01 +01:00
parent 2522492835
commit a4acfeceee
4 changed files with 49 additions and 0 deletions

17
toolchain-i686-elf.cmake Normal file
View 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")