The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=16046 
====================================================================== 
Reported By:                stw_sesa
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16046
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-04-01 08:56 EDT
Last Modified:              2016-04-01 08:56 EDT
====================================================================== 
Summary:                    GHS Multi Generator: duplicate object file names
Description: 
When a target contains multiple files with the same name (in different
(sub)folders) the generated object files will have the same names too. Normally
this isn't a problem at all, but for GHS MULTI it is as the duplicates are
ignored.

Steps to Reproduce: 
Create a project with a target containing at least two files with the same name
like this:
add_library(libdemo test.c subfolder/test.c )

Expected result:
The library contains both test.o and subfolder/test.o

Actual result:
Only one of these source files is compiled and archived in the library due to
their name equality.


A sample project is attached, that will build successfully using other C project
generators (e.g Makefile), but won't when using GHS MULTI toolchain.

Additional Information: 
This could also be either a bug in MULTI Project Manager or intended behaviour.
However, from the CMake perspective the results are unexpected.

A workaround for the generator would be to rename the generated object file by
emitting a unique object file name with the option "-o <filename>.o" in the
generated project files (.gpj).

Is there any CMake workaround? (which doesn't require changing CMake itself)
Maybe there is an project file option that changes that behaviour?

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-04-01 08:56 stw_sesa       New Issue                                    
2016-04-01 08:56 stw_sesa       File Added: dup_objname_test.zip                
   
======================================================================

-- 

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