ARMClang: DEFINES are not passed to assembler
We preprocess assembly files in our project (all files are .S) by default. DEFINES are passed to assembler for Gcc Arm (we enabled -x assembler-with-cpp), but we noticed ARMClang does not pass DEFINES (see Ninja rules below). We are currently testing armclang for assembly files (I recall I had the same issue with armasm).
I verified with Ninja and Unix Makefiles. Here are Ninja rules:
# Rule for compiling ASM files.
rule ASM_COMPILER__project_Develop
depfile = $DEP_FILE
deps = gcc
command = armclang.exe $INCLUDES $FLAGS -c -o $out $in
description = Building ASM object $out
I can't find a way to enable passing DEFINES to ASM, was it intentionally not enabled? armclang
or armasm
supports preprocessing assembly files.
Our current workaround is:
target_compile_options(${target}
PUBLIC
$<$<COMPILE_LANGUAGE:ASM>:-masm=armasm ${_asm_macros}>
)
where _asm_macros
is set of -D we want to pass to ASM