GCC offers an assembler option to generate list files:
-Wa,-adhln=<path/file.lst>
I know my way around in cmake but I am pulling my hair how to get this in. My struggle is because it is per source file that I like to have the option and the output file is based on the source file name.
Note1: I am crosscompiling for renesas RL78 but that should not matter
Note2: If I run this command manually it works; the list file is generated
So to be clear I like the compile steps to be like this:
AFAIK, there’s no way to add such a flag except one-by-one. You can set the source file property COMPILE_OPTIONS to contain this, but there’s no way to say “where the object file will be written” to get its directory (yet?).
Thanks @ben.boeckel for the hint. As I reference I like to paste my final solution here for anybody who can use it. The list files end up at the location where the source file resides. If one uses git a simple "git clean -dxf’ will remove them (and all other files that are not registered in the git project!)
cmake_minimum_required(VERSION 3.0)
project(test_list_files)
include_directories(hdr)
set (headers
hdr/add.h
hdr/subtract.h
hdr/multiply.h
hdr/divide.h
)
set (sources
src/main.c
src/add.c
src/subtract.c
src/multiply.c
src/divide.c
)