The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15842 
====================================================================== 
Reported By:                veeg
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15842
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-11-10 15:58 EST
Last Modified:              2015-11-10 15:58 EST
====================================================================== 
Summary:                    project() duplicate language / erroneous API usage
results in incorrect file endings on object files.
Description: 
Using the (arguably incorrect format) of the project() command:
  project (testproj C VERSION 1.0.0 LANGUAGES C)
is validated and passes Makefile generation. However, the output file extension
for object files results in *.c, and not *.c.o

Attached CMakeLists.txt produced the following object file path
  CMakeFiles/test_executable.dir/test.c

When attempted linked into an executable, the compiler thinks the inputfiles are
source files, not object files, due the file ending. Therefore, it spews out an
endless stream of "stray '\xxx' in program" (gcc does atleast). Not so user
friendly to detect what actually went wrong.

Steps to Reproduce: 
See attached CMakeLists.txt for MWE.

* Put attached CMakeLists.txt in empty folder
* issue CMake command to build makefiles:
** "cmake ."
* Build executable
** "make"

Output:
[ 50%] Linking C executable test_executable.exe
CMakeFiles/test_executable.dir/test.c:1:1: error stray `\206` in program ...
...
..
..
..

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-11-10 15:58 veeg           New Issue                                    
2015-11-10 15:58 veeg           File Added: CMakeLists.txt                    
======================================================================

-- 

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