Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -O3 Optimization Option #25

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(PRODUCT_NAME microfido2)
#######################################
# Compilation

set(CMAKE_C_FLAGS_RELEASE "-Os")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_DEBUG "-ggdb -O0")

add_compile_options(
Expand Down Expand Up @@ -81,8 +81,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/tinf/include)
# Add Monocypher library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/Monocypher)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/Monocypher/include)
# Always use -Os, even if it is a debug build, because Monocypher is very large and would be even larger with debug information.
target_compile_options(Monocypher PRIVATE -Os)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# Use -Os in debug build because otherwise it wouldn't fit on AVR.
target_compile_options(Monocypher PRIVATE -Os)
endif()
target_compile_definitions(Monocypher PRIVATE PERIODICALLY_RESET_WATCHDOG)

# Link the object libraries
Expand Down