Skip to content

Commit b6a7848

Browse files
fix(build): inherit NumericalToolbox_ENABLE_OPTIMIZATIONS from numerical.math (#21)
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. Claude-Session: https://claude.ai/code/session_01N4pngRiBqeb1xiseKXNLG6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 80029ab commit b6a7848

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ if (ROBOTICS_TOOLBOX_BUILD_TESTS)
1616
add_definitions(-DNUMERICAL_TOOLBOX_ENABLE_ASSERTIONS=1)
1717
endif()
1818

19-
if (ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS)
20-
add_definitions(-DNumericalToolbox_ENABLE_OPTIMIZATIONS=1)
21-
endif()
22-
2319
if (EMIL_ENABLE_COVERAGE)
2420
add_definitions(-DROBOTICS_TOOLBOX_COVERAGE_BUILD=1)
2521
endif()
@@ -51,9 +47,11 @@ if (NOT TARGET numerical.math)
5147
FetchContent_Declare(
5248
numerical_toolbox
5349
GIT_REPOSITORY https://github.com/embedded-pro/numerical-toolbox-cpp.git
54-
GIT_TAG 1225b3c422beab93e0ff8fd7231f8d7e087f6da4 # main
50+
GIT_TAG 69ff13e719895b74b167c4742130442c6b96a857 # main
5551
)
5652

53+
set(NUMERICAL_TOOLBOX_ENABLE_OPTIMIZATIONS ${ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS} CACHE BOOL "" FORCE)
54+
5755
FetchContent_MakeAvailable(numerical_toolbox)
5856
endif()
5957

0 commit comments

Comments
 (0)