Make build-debug.sh work

This commit is contained in:
apio 2022-12-04 10:27:25 +01:00
parent 9a6d0d1bae
commit 5d9c50eb12
2 changed files with 22 additions and 0 deletions

View File

@ -52,6 +52,11 @@ if("${ARCH}" MATCHES "x86_64")
target_link_options(moon PRIVATE -mno-red-zone)
endif()
if(MOON_DEBUG_SYMBOLS)
message(STATUS "Building Moon with debug symbols")
target_compile_options(moon PRIVATE -ggdb)
endif()
target_link_options(moon PRIVATE -lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mcmodel=kernel)
set_target_properties(moon PROPERTIES CXX_STANDARD 20)

17
tools/build-debug.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
source $(dirname $0)/env.sh
cd $LUNA_ROOT
tools/setup.sh
rm -rf $BUILD_DIR
mkdir $BUILD_DIR
cmake -S . -B $BUILD_DIR -DMOON_DEBUG_SYMBOLS=ON -G "$CMAKE_GEN"
cmake --build $BUILD_DIR
cmake --install $BUILD_DIR
mkbootimg luna.json Luna.iso