.lst file generation in cmake

i want to generate .lst files for my source file. I am successfully able to generate the executable. But i dont know how to generate .lst files for my source files.

get_property(allsrcfiles TARGET myExe PROPERTY SOURCES)
foreach(srcfile IN LISTS allsrcfiles)
set_source_files_properties(${srcfile} PROPERTIES COMPILE_FLAGS "-Wa, anhlmsd=${srcfile}.lst")

I have added the above script in my CMakelists.txt , if I add the above script iam getting the following error

[100%] Linking C executable myExe
dld: error: Can't open file 'CMakeFiles/myExe.dir/src/sample.c.obj': No such file or directory
CMakeFiles\myExe.dir\build.make:101: recipe for target 'myExe' failed gmake[2]: *** [myExe] Error 1
CMakeFiles\Makefile2:93: recipe for target 'CMakeFiles/myExe.dir/all' failed
gmake[1]: *** [CMakeFiles/myExe.dir/all] Error 2
Makefile:101: recipe for target 'all' failed
gmake: *** [all] Error 2

sample.c.obj file is getting generated without source_file_properties.

compiler : WIND RIVER Target : ppc - embedded Host : windows

is list file generation commands depends on the compiler ?

Read more here: https://stackoverflow.com/questions/65840053/lst-file-generation-in-cmake

Content Attribution

This content was originally published by deepan muthusamy at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: