Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
109 views
in Technique[技术] by (71.8m points)

.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 don't 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")
endforeach()

I have added the above script in my CMakelists.txt, if I add the above script I am 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
CMakeFilesmyExe.diruild.make:101: recipe for target 'myExe' failed gmake[2]: *** [myExe] Error 1
CMakeFilesMakefile2: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?

question from:https://stackoverflow.com/questions/65840053/lst-file-generation-in-cmake

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...