Hi, I’m setting up my first project with CMake and am struggling with compile options specific to the armasm.exe we’re using in the company.
The goal is to get the following command line (stripped down) for assembly files: armasm.exe --pd "__UVISION_VERSION SETA 536" --pd "STM32F427xx SETA 1" (etc.)
I tried various approaches but either it works for ASM files or C files.
Spot on, thank you very much.
Are the quotes required because of the SHELL: prefix? I added other options (without prefixes) with unquoted genex, and those work fine.
The quotes are required due to the spaces in the value. Without the overall quoting, there will be $<GENEX:SHELL:--pd and \"value\"> arguments to target_compile_options (essentially injecting a ; into the value).
Thanks for pointing that out. Then $<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:C>>:--asm -c --interleave>
only works without quotes because the individual options do not take any additional values.
I am surprised that $<$<COMPILE_LANGUAGE:CXX,C>:--signed_chars --split_sections --no_exceptions --no_rtti> works as expected because it will be seen as the following list:
So, the genex is malformed and cannot be evaluated…
For the second ex[pression, this is because you don’t use correctly the genex. What is expected by the genex is a CMake list, and you specify a string. Correct expression is:
The malformed genex indeed creates a working result as I can see in compile_commands.json.
I changed it to a list, and of course, it works like a charm now.
Thank you