The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15818 
====================================================================== 
Reported By:                maarten
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15818
Category:                   CMake
Reproducibility:            always
Severity:                   text
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2015-10-28 21:53 EDT
Last Modified:              2015-10-28 21:53 EDT
====================================================================== 
Summary:                    The variable CMAKE_ASM_OUTPUT_EXTENSION is ignored
when creating a compiled file
Description: 
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'


Steps to Reproduce: 
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)

Additional Information: 
A simple sdcc config is attached.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-10-28 21:53 maarten        New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to