Skip to content
Snippets Groups Projects
Commit a60fe9e5 authored by q3k's avatar q3k
Browse files

*: turn floating-point literals into single-precision floats

Turns out '1.1' is by default double-precision. That's a waste of
resources. And we also are never going to remember to suffix this stuff.
parent ca206ca0
Branches
Tags
No related merge requests found
...@@ -5,3 +5,16 @@ set(IDF_TARGET esp32s3) ...@@ -5,3 +5,16 @@ set(IDF_TARGET esp32s3)
include($ENV{IDF_PATH}/tools/cmake/project.cmake) include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(flow3r) project(flow3r)
# Make `1.1` literals into single-point precision float instead of double
# precision. Also warn any time something gets promoted to a double. We
# generally don't want doubles, doubles on ESP32 bad.
idf_component_get_property(st3m_lib st3m COMPONENT_LIB)
idf_component_get_property(flow3r_bsp_lib flow3r_bsp COMPONENT_LIB)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(${st3m_lib} PRIVATE -cl-single-precision-constant -Wdouble-promotion)
target_compile_options(${flow3r_bsp_lib} PRIVATE -cl-single-precision-constant -Wdouble-promotion)
else()
target_compile_options(${st3m_lib} PRIVATE -fsingle-precision-constant -Wdouble-promotion)
target_compile_options(${flow3r_bsp_lib} PRIVATE -fsingle-precision-constant -Wdouble-promotion)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment