CChenX / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

ninja generator doesn't handle LinkTimeCodeGeneration for VCLinkerProperly #343

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
https://code.google.com/p/gyp/source/browse/trunk/pylib/gyp/msvs_emulation.py#44
7

should be mapping 'true', not '1'

Original issue reported on code.google.com by sgraham on 1 Jun 2013 at 5:10

GoogleCodeExporter commented 9 years ago

Original comment by scottmg@chromium.org on 1 Jun 2013 at 11:14

GoogleCodeExporter commented 9 years ago
Seems that both VCLinkerProperly and VCLibrarianTool have 
LinkTimeCodeGeneration property.
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.v
clibrariantool.linktimecodegeneration.aspx
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.v
clinkertool.linktimecodegeneration.aspx

For ninja generator, my r1553 fixed the VCLibrarianTool.LinkTimeCodeGeneration. 
But my patch didn't touch VCLinkerProperly.LinkTimeCodeGeneration.

I'll take a look.

Original comment by yukawa@chromium.org on 23 Nov 2013 at 12:23

GoogleCodeExporter commented 9 years ago
Hi sgraham,

Thank you for the report, but after some investigation, I concluded that this 
is not a bug. You should put '1' rather than 'true' there.

The code you pointed is used to emulate VCLinkerTool.LinkTimeCodeGeneration, 
which should be mapped into LinkTimeCodeGenerationOption enumeration rather 
than boolean.  Then, the value '1' corresponds to 
LinkTimeCodeGenerationOption.LinkTimeCodeGenerationOptionUse. So there is no 
problem to map '1' to '/LTCG' there.
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.v
clinkertool.linktimecodegeneration.aspx
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.l
inktimecodegenerationoption.aspx

BTW, I made https://codereview.chromium.org/82703007/ so that we can cover 
other LTGC options as well as 
LinkTimeCodeGenerationOption.LinkTimeCodeGenerationOptionUse. I hope this patch 
makes it clearer why msvs emulator for Ninja accepts number rather than boolean 
in 'VCLinkerTool.LinkTimeCodeGeneration'.

Thank you again for the report and feel free to ping us if you still think this 
is a bug.

Original comment by yukawa@chromium.org on 23 Nov 2013 at 4:55