Apply -flax-vector-conversions flag to GCC

Some CMSIS-DSP code does not explicitly convert between vectors of
different numbers and types of elements. While some other compilers
default to implicitly converting vectors, gcc does not do this unless
explicitly enabled.

Signed-off-by: Lingkai Dong <lingkai.dong@arm.com>
pull/65/head
Lingkai Dong 3 years ago
parent 9c425b04b9
commit 8a55a7c07e

@ -47,6 +47,12 @@ if (HELIUM OR MVEF OR SUPPORT)
target_include_directories(${project} PRIVATE "${DSP}/PrivateInclude")
endif()
if (MVEI OR MVEF OR HELIUM)
# By default, GCC does not enable implicit conversion between vectors of different numbers or types of elements
# which is required by some code in CMSIS-DSP
target_compile_options(${project} PRIVATE $<$<STREQUAL:${CMAKE_C_COMPILER_ID},GNU>:-flax-vector-conversions>)
endif()
if (DISABLEFLOAT16)
target_compile_definitions(${project} PRIVATE DISABLEFLOAT16)
endif()

Loading…
Cancel
Save