Why do you want to generate temporary asm file? Your compiler is not able to directly generate object file?
Answer:You know, in MCU development, sometimes the asm files are useful for the debugging if necessary. The object files actually could be generate directly in another way. I just want to know, by CMake, if it is possible to do all the process what I did in makefile before .
- I think it is not possible.Why do you want this, anyway?
Answer: I just want to know whether there existed a way to set the rule, because I am a new CMake user, I hope to grasp more
CMAKE_C_COMPILE_OBJECT
is aCMake
list. So multiple commands can be specified.
Answer: I used ‘&&’ to connect the two command, but failed. I thought the < test_variable> in CMAKE_C_COMPILE_OBJECT could be a defined cmake-variable, but some of them doesn’t work.
please correct me if I misunderstood it. and I 'd be appreciated that if you could offer me some advice about the definition of < variable>'s in the command, and how to find their definitions. ( like “CMAKE_C_COMPILE_OBJECT” could be found int Modules/CMakeCInformation.cmake )
< test_variable> and ${test_variable} seems different, what’s the difference?
thanks a lot for your quick reply
m(_ _)m
I defined compiler as follows:
SET(CMAKE_C_COMPILER “${CCPATH}/ctc/bin/ctc.exe”)
SET(CMAKE_CXX_COMPILER “${CCPATH}/ctc/bin/cptc.exe”)
SET(CMAKE_ASM_COMPILER “${CCPATH}/ctc/bin/astc.exe”)
SET(CMAKE_LINKER “${CCPATH}/ctc/bin/ltc.exe”)
set(CMAKE_C_COMPILE_OBJECT
“<CMAKE_C_COMPILER> -o .src
In build.ninja file, only "CMAKE_ASM_COMPILER " could NOT be replaced by the actual path, I don’t know the reason why… (while c/cxx/link works well)
I used ${CMAKE_ASM_COMPILER} instead of < CMAKE_ASM_COMPILER>, it seems that it could works, but I want to know the difference, the system ASM compiler did not be correctly defined like C compiler in my env. it might be some settings missing in my CMakelist.txt