From 1280528e4eda34b5a96a43c401106f2eaac8ed19 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 20 Sep 2024 20:04:49 +0300 Subject: [PATCH] BuildSystem: Use -O2 for all libraries I don't know why I had not specified optimization level for libraries. Only LibImage was using explicit -O3. LibImage doesn't need O3 anymore as O2 seems to be around the same speed. --- userspace/libraries/CMakeLists.txt | 2 ++ userspace/libraries/LibImage/CMakeLists.txt | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/userspace/libraries/CMakeLists.txt b/userspace/libraries/CMakeLists.txt index 3cb90d6d7d..370f73ca8c 100644 --- a/userspace/libraries/CMakeLists.txt +++ b/userspace/libraries/CMakeLists.txt @@ -19,6 +19,8 @@ foreach(library ${USERSPACE_LIBRARIES}) add_dependencies(libraries ${library_lower}) # This is to allow cmake to link when libc updates target_link_options(${library_lower} PRIVATE -nolibc) + # Default compile options + target_compile_options(${library_lower} PRIVATE -g -O2) target_compile_definitions(${library_lower} PRIVATE __enable_sse=${BANAN_ENABLE_SSE}) if (NOT BANAN_ENABLE_SSE) diff --git a/userspace/libraries/LibImage/CMakeLists.txt b/userspace/libraries/LibImage/CMakeLists.txt index 33597d3405..4fcddaf048 100644 --- a/userspace/libraries/LibImage/CMakeLists.txt +++ b/userspace/libraries/LibImage/CMakeLists.txt @@ -5,7 +5,6 @@ set(LIBIMAGE_SOURCES ) add_library(libimage ${LIBIMAGE_SOURCES}) -target_compile_options(libimage PRIVATE -O3) banan_link_library(libimage libc) banan_link_library(libimage ban)