Skip to content

Commit

Permalink
use single-percision contants for ZSL_SINGLE_PERCISION is set
Browse files Browse the repository at this point in the history
Set the compilier flag for gcc or armclang to force constants to be
single percision.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
  • Loading branch information
XenuIsWatching committed Dec 10, 2023
1 parent db05e1e commit a8f4711
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ zephyr_library_sources(
)
#zephyr_library_sources_ifdef(CONFIG_ZSL_SINGLE_PRECISION src/zsl_todo.c)

zephyr_library_compile_options_ifdef(CONFIG_ZSL_SINGLE_PRECISION $<$<STREQUAL:${CMAKE_C_COMPILER_ID},GNU>:-fsingle-precision-constant>)
zephyr_library_compile_options_ifdef(CONFIG_ZSL_SINGLE_PRECISION $<$<STREQUAL:${CMAKE_C_COMPILER_ID},ARMClang>:-cl-single-precision-constant>)

zephyr_library_link_libraries(ZSCILIB)
target_link_libraries(ZSCILIB INTERFACE zephyr_interface)
endif()

0 comments on commit a8f4711

Please sign in to comment.