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

Geoffrey Viola Geoffrey.Viola at asirobots.com
Sun Apr 24 15:57:40 EDT 2016


I didn't understand why the visual studio target used the target's AddExplicitObjectName so that the visual studio global class could use it. It seems roundabout.

The Green Hills MULTI IDE has a few different quirks from visual studio.
1. It counts the extension as a difference in the filename
2. It ignores the '/'

Attached is a patch that handles duplicate filenames by prepending collided filepaths with the absolute paths. The full path uses '_' instead of ":/" and '/', since MULTI ignores that. There's also a test that should work with the other generators.

Geoff


-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Monday, April 18, 2016 9:28 AM
To: Geoffrey Viola <Geoffrey.Viola at asirobots.com>
Cc: cmake-developers at cmake.org
Subject: Re: [cmake-developers] 0016046: GHS Multi Generator: duplicate object file names

On 04/17/2016 04:22 PM, Geoffrey Viola wrote:
> Attached is a patch to fix the bug tracked at https://cmake.org/Bug/view.php?id=16046.
> It adds a special source property to set the obj filename for the GHS MULTI generator.
> It is necessary, because GHS MULTI has a bug where it can't compile
> two source files with the same filenames.

Thanks.  However, I do not think it should be the project's responsibility to set the OBJECT_FILE property for this.  CMake's VS IDE generator has the same problem so we generate specific object file names automatically when the defaults will not be unique.  See logic here:

  cmLocalVisualStudioGenerator::ComputeObjectFilenames
  https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalVisualStudioGenerator.cxx;hb=v3.5.2#l41

and use of AddExplicitObjectName in particular.

-Brad

This message contains confidential information and is intended only for the recipient. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Green-Hills-MULTI-handles-duplicate-source-filenames.patch
Type: application/octet-stream
Size: 6425 bytes
Desc: 0001-Green-Hills-MULTI-handles-duplicate-source-filenames.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160424/833fe363/attachment.obj>


More information about the cmake-developers mailing list