[cmake-developers] [CMake 0016046]: GHS Multi Generator: duplicate object file names

Mantis Bug Tracker mantis at public.kitware.com
Fri Apr 1 08:56:41 EDT 2016


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                
   
======================================================================



More information about the cmake-developers mailing list