How to specify Assembler options for ARM?

My CMake project for ARM Cortex-M4 contains:

set(CMAKE_ASM_FLAGS "")
set_property(SOURCE ${RTX_SOURCE_PATH}/GCC/irq_armv7m.S APPEND PROPERTY COMPILE_OPTIONS "--target=arm-arm-none-eabi" "-x" "assembler-with-cpp" "-g" "-masm=auto" )

in order to set the assembler options.
However, the resulting assember command is:

armclang.exe" -DARMCM4_FP -D_RTE_ -I<snip> -mcpu=cortex-m4 -mfpu=none -mlittle-endian -xc -Oz -g -Wall -fshort-enums -fshort-wchar -ffunction-sections -fno-rtti --target=arm-arm-none-eabi -x assembler-with-cpp -g -masm=auto -c -o CMakeFiles/CMSIS-RTOS2_Blinky.dir/<snip>/irq_armv7m.o irq_armv7m.S

That is, CMake is adding additional options to the command (perhaps from CFLAGS?). How can I cause make the assembler command exactly those options I specified?

1 Like