diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index fca7d1f7..6fdc6fbf 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -74,8 +74,6 @@ target_link_libraries(moon luna-freestanding) target_compile_definitions(moon PRIVATE IN_MOON) -target_compile_options(moon PRIVATE -Os) - target_compile_options(moon PRIVATE -Wall -Wextra -Werror -Wvla -Wsign-conversion) target_compile_options(moon PRIVATE -Wdisabled-optimization -Wformat=2 -Winit-self) target_compile_options(moon PRIVATE -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef) @@ -94,6 +92,8 @@ if(MOON_DEBUG_SYMBOLS) message(STATUS "Building Moon with debug symbols") target_compile_options(moon PRIVATE -ggdb) include(debug.cmake) +else() + target_compile_options(moon PRIVATE -Os) endif() target_link_options(moon PRIVATE -lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mcmodel=kernel)