tsb: drop the local -O3 strip, now handled by the libavr toolchain

The -O3 leak is fixed upstream (cmake/release-os.cmake via CMAKE_PROJECT_INCLUDE),
so the port no longer needs its own string(REPLACE); a Release build is -Os
through the toolchain file. Verified: all three variants build at their sizes
(508/658/740) and pass the size + protocol ctest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 10:52:13 +02:00
parent 64c1e484b5
commit 2906da3272

View File

@@ -2,13 +2,6 @@ cmake_minimum_required(VERSION 3.28)
project(tsb_libavr LANGUAGES CXX)
# CMake's GNU compiler module appends "-O3 -DNDEBUG" to CMAKE_CXX_FLAGS_RELEASE
# after the libavr toolchain sets "-Os", and the later -O3 wins — so a Release
# build is silently -O3, ~15-20 % larger than -Os. For a boot loader measured to
# the byte that is fatal, so strip it and get the size build the design intends.
# (The same leak affects libavr's own Release builds; a fix belongs upstream.)
string(REPLACE "-O3" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
# libavr from a local checkout (LIBAVR_ROOT) or the forge; the toolchain file
# comes from the same checkout via CMakePresets.json.
include(FetchContent)