Generator Expression "--config" bug
Version: CMake 3.15.4 on Windows 10
I'm using IAR and want to include a linker symbol. The flag for this is
--config_def __my_symbol__=0x1234
However, cmake likes to throw away the '--config_def'. Looking at my link.txt file, the only text I see is __my_symbol__=0x1234
.
This is weird, because if I just put the flag in the target_link_options command, it works fine. I can get around this by using the CMAKE_EXE_LINKER_FLAGS variable and surrounding it with an if but this is ugly and not 'modern' as I understand it.
target_link_options(UTB2 PUBLIC
--config_def __heap_size__=0x2FFFF ### THIS works fine
--no_out_extension
--config ${LINKER_SCRIPT} ### THIS also works fine
--entry __iar_program_start
--no_exceptions
--vfe
--text_out locale
--advanced_heap
### THESE DO NOT WORK
# $<$<AND:$<C_COMPILER_ID:IAR>,$<CONFIG:DEBUG>>: --config_def __program_flash_start__=0x0000 >
# $<$<AND:$<C_COMPILER_ID:IAR>,$<CONFIG:RELEASE>>: --config_def __program_flash_start__=0x20000 >
)
If I misspell 'config' in some way (ie. cifig_def, confh_def, confbig_def) the flag gets all the way through to the link.txt file but as soon as I spell 'config' correctly, it gets removed. Could this be a parser issue in generator expressions?