MantisBT - CMake
View Issue Details
0015818CMakeCMakepublic2015-10-28 21:532016-06-10 14:31
maarten 
Kitware Robot 
lowtextalways
closedmoved 
LinuxFedora Linux 2222
CMake 3.3.2 
 
0015818: The variable CMAKE_ASM_OUTPUT_EXTENSION is ignored when creating a compiled file
The sdcc compiler has ".asm" extensions for the assembly files.
But cmake always assumes the ".s" extension.
https://github.com/Kitware/CMake/blob/d288b216af6864567354ccb05e85466fb57d46b0/Source/cmMakefileTargetGenerator.cxx#L802-L803 [^]

For a source file 'main.c', 'make help' shows the following targets:
... main.rel
... main.i
... main.s

Running 'make main.s' gives the following output:
Compiling C source to assembly CMakeFiles/proj1.dir/main.c.s

But in the CMakeFiles/proj1.dir, there is no 'main.c.s' file.
The generated assembly file is 'main.c.asm'
1) Create toolchain file with:
   - CMAKE_SYSTEM_NAME = Generic
   - CMAKE_ASM_SOURCE_FILE_EXTENSIONS = asm
   - CMAKE_C_C_CREATE_ASSEMBLY_SOURCE = "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>"
   - set CMAKE_C_COMPILER, CMAKE_FIND_ROOT_PATH, ...
2) Create a basic main.c
3) Create CMakeLists.txt, with
   - CMAKE_C_FLAGS = "-Werror --model-small -mmcs51 --opt-code-size"
4) Run CMake to generate the makefiles (using the toolchain)
5) Run "make help" (main.s will show up)
6) Run "make main.s" (main.asm will be created instead of main.s)
7) Run "make main.asm" (An error will be shown)
A simple sdcc config is attached.
No tags attached.
zip sdcc_asm.zip (967) 2015-10-28 21:54
https://public.kitware.com/Bug/file/5561/sdcc_asm.zip
Issue History
2015-10-28 21:53maartenNew Issue
2015-10-28 21:54maartenFile Added: sdcc_asm.zip
2016-06-10 14:29Kitware RobotNote Added: 0042870
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042870)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.