diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 8f0cdef2..4ab52d3b 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -1,5 +1,6 @@ function(luna_app SOURCE_FILE APP_NAME) add_executable(${APP_NAME} ${SOURCE_FILE}) + target_compile_options(${APP_NAME} PRIVATE -Os -Wall -Wextra -pedantic -Werror) add_dependencies(${APP_NAME} libc) target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include) install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/bin) diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index 270ecf41..b731ca1c 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -31,7 +31,8 @@ target_link_libraries(bare_libc PUBLIC luna) target_include_directories(bare_libc PUBLIC include/) -target_compile_options(bare_libc PRIVATE -Wall -Wextra -Werror -pedantic -nostdlib -fno-exceptions -fno-rtti) +target_compile_options(bare_libc PRIVATE -Os -Wall -Wextra -Werror -pedantic -nostdlib) +target_compile_options(bare_libc PRIVATE -fno-exceptions -fno-rtti) target_link_options(bare_libc PRIVATE -nostdlib) diff --git a/luna/CMakeLists.txt b/luna/CMakeLists.txt index 4fbc5114..cf7be482 100644 --- a/luna/CMakeLists.txt +++ b/luna/CMakeLists.txt @@ -25,7 +25,7 @@ set(SOURCES add_library(luna-freestanding ${FREESTANDING_SOURCES}) target_compile_definitions(luna-freestanding PRIVATE USE_FREESTANDING) -target_compile_options(luna-freestanding PRIVATE -Wall -Wextra -Werror -Wvla) +target_compile_options(luna-freestanding PRIVATE -Os -Wall -Wextra -Werror -Wvla) target_compile_options(luna-freestanding PRIVATE -Wdisabled-optimization -Wformat=2 -Winit-self -Wsign-conversion) target_compile_options(luna-freestanding PRIVATE -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef) target_compile_options(luna-freestanding PRIVATE -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion) @@ -37,7 +37,7 @@ target_include_directories(luna-freestanding PUBLIC include/) set_target_properties(luna-freestanding PROPERTIES CXX_STANDARD 20) add_library(luna ${SOURCES}) -target_compile_options(luna PRIVATE -Wall -Wextra -Werror -Wvla) +target_compile_options(luna PRIVATE -Os -Wall -Wextra -Werror -Wvla) target_compile_options(luna PRIVATE -Wdisabled-optimization -Wformat=2 -Winit-self) target_compile_options(luna PRIVATE -Wmissing-include-dirs -Wswitch-default -Wcast-qual -Wundef) target_compile_options(luna PRIVATE -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Wconversion)