From a66049640e8f9ddf465042aba6fa5bae31b46ca1 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 06:41:40 +0000 Subject: [PATCH] fix(build): inherit NumericalToolbox_ENABLE_OPTIMIZATIONS from numerical.math The define was set with directory-scoped add_definitions, so it never reached the translation units of projects consuming this library and OPTIMIZE_FOR_SPEED silently expanded to nothing there. numerical-toolbox now attaches it as a usage requirement of numerical.math (embedded-pro/numerical-toolbox-cpp#346): bump the pin to include that change, forward ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS to NUMERICAL_TOOLBOX_ENABLE_OPTIMIZATIONS, and drop the add_definitions. Mirrors embedded-pro/numerical-toolbox-cpp#337. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N4pngRiBqeb1xiseKXNLG6 --- CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eb54b0..1d04436 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,10 +16,6 @@ if (ROBOTICS_TOOLBOX_BUILD_TESTS) add_definitions(-DNUMERICAL_TOOLBOX_ENABLE_ASSERTIONS=1) endif() -if (ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS) - add_definitions(-DNumericalToolbox_ENABLE_OPTIMIZATIONS=1) -endif() - if (EMIL_ENABLE_COVERAGE) add_definitions(-DROBOTICS_TOOLBOX_COVERAGE_BUILD=1) endif() @@ -51,9 +47,11 @@ if (NOT TARGET numerical.math) FetchContent_Declare( numerical_toolbox GIT_REPOSITORY https://github.com/embedded-pro/numerical-toolbox-cpp.git - GIT_TAG 1225b3c422beab93e0ff8fd7231f8d7e087f6da4 # main + GIT_TAG 69ff13e719895b74b167c4742130442c6b96a857 # main ) + set(NUMERICAL_TOOLBOX_ENABLE_OPTIMIZATIONS ${ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS} CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(numerical_toolbox) endif()