MantisBT - CMake
View Issue Details
0015894CMakeCMakepublic2015-12-23 08:042016-06-10 14:21
Thomas Laguzzi 
Brad King 
normalmajoralways
closedfixed 
WindowsWindows 10Windows 10 64bit
CMake 3.4.1 
CMake 3.4.2CMake 3.4.2 
0015894: Visual C++ 2015 Generator wrong output for debug information
In 2015 there are three options to generate debug informations: None, Debug , Debug with fastlink
(/DEBUG and /DEBUG:FASTLINK)

The <GenerateDebugInformation> tag in the .vcxproj file doesn't take true or false anymore, instead it takes 3 values

No
Debug
DebugFastLink

depending on the option choosen, else you will see a wrong property value in the property sheet

Note: it's not sufficient to add /DEBUG:FASTLINK to the additional options, it is ignored unless the .vcxproject file is correct.
Just generate any Visual C++ project using Visual C++ 2015 (update 1).
Tryed with Update 1 both 32 and 64bit.
Don't know if previous versions have the same issue.
patch
related to 0015986closed Brad King Visual Studio 2015 does not work with v120 toolset 
patch cmake.patch (3,374) 2016-01-04 09:14
https://public.kitware.com/Bug/file/5601/cmake.patch
txt CMakeLists.txt (214) 2016-01-04 09:14
https://public.kitware.com/Bug/file/5602/CMakeLists.txt
patch cmake-corrected.patch (3,382) 2016-01-04 09:22
https://public.kitware.com/Bug/file/5603/cmake-corrected.patch
Issue History
2015-12-23 08:04Thomas LaguzziNew Issue
2016-01-04 09:14Thomas LaguzziFile Added: cmake.patch
2016-01-04 09:14Thomas LaguzziFile Added: CMakeLists.txt
2016-01-04 09:21Thomas LaguzziNote Added: 0040050
2016-01-04 09:22Thomas LaguzziFile Added: cmake-corrected.patch
2016-01-04 09:22Thomas LaguzziTag Attached: patch
2016-01-08 14:19Brad KingNote Added: 0040163
2016-01-09 10:32Thomas LaguzziNote Added: 0040170
2016-01-11 09:53Brad KingNote Added: 0040178
2016-01-11 09:54Brad KingNote Added: 0040179
2016-01-11 09:58Brad KingNote Added: 0040180
2016-01-11 10:00Brad KingNote Added: 0040181
2016-01-11 10:00Brad KingAssigned To => Brad King
2016-01-11 10:00Brad KingStatusnew => resolved
2016-01-11 10:00Brad KingResolutionopen => fixed
2016-01-11 10:00Brad KingFixed in Version => CMake 3.5
2016-01-11 10:00Brad KingTarget Version => CMake 3.5
2016-01-11 15:32Thomas LaguzziNote Added: 0040194
2016-01-11 15:55Brad KingNote Added: 0040195
2016-01-20 10:26Brad KingNote Added: 0040275
2016-01-20 10:26Brad KingFixed in VersionCMake 3.5 => CMake 3.4.2
2016-01-20 10:26Brad KingTarget VersionCMake 3.5 => CMake 3.4.2
2016-02-24 11:30Gregor JasnyRelationship addedrelated to 0015986
2016-06-10 14:21Kitware RobotNote Added: 0041243
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0040050)
Thomas Laguzzi   
2016-01-04 09:21   
I attached a possible patch.
Two things I didn't know:
- how to switch the behavior between the generators. I added a virtual function to select the old/new behavior, but the name probably is wrong.
- Also, when using fastlink ,the new "Generate Full PDB files" option may be useful in some scenarios. Unfortunately that option doesn't have a command line switch, so I actually used a boolean TARGET_PROPERTY which I named LINK_FULL_PDBS , another probably wrong name

See the CmakeLists.txt attached which I used to check the results.

reference link:
(http://blogs.msdn.com/b/vcblog/archive/2015/10/16/debug-fastlink-for-vs2015-update-1.aspx [^])
(0040163)
Brad King   
2016-01-08 14:19   
Thanks. First I'd like to fix the normal false/true values to fix existing behavior. Please try out this change:

 VS: Fix VS 2015 .vcxproj file value for GenerateDebugInformation
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f086c665 [^]
(0040170)
Thomas Laguzzi   
2016-01-09 10:32   
tested: the commit works, it generates a correct XML
(0040178)
Brad King   
2016-01-11 09:53   
Re 0015894:0040170: Great, thanks for testing. I've merged that change to 'master' and queued it for merge to 'release' for 3.4.2.
(0040179)
Brad King   
2016-01-11 09:54   
Next I've followed up with these changes based on 'master':

 cmIDEOptions: Add support for case-insensitive flags
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ca9df8b [^]

 VS: Drop unused condition in link debug flag generation
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c22da7cf [^]

 VS: Map the link `/debug` to its IDE property
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3677b35 [^]

This cleans up conversion of the /debug flag to the IDE property.
(0040180)
Brad King   
2016-01-11 09:58   
Now we should be able to move on to /debug:fastlink support. After the cleanup linked in 0015894:0040179 the change can now be something like:

------------------------------------------------------------------------------
diff --git a/Source/cmVS14LinkFlagTable.h b/Source/cmVS14LinkFlagTable.h
index 1e781e8..29e3d86 100644
--- a/Source/cmVS14LinkFlagTable.h
+++ b/Source/cmVS14LinkFlagTable.h
@@ -177,6 +177,8 @@ static cmVS7FlagTable cmVS14LinkFlagTable[] =
   {"UACUIAccess", "uiAccess='false'", "", "false", 0},
   {"UACUIAccess", "uiAccess='true'", "", "true", 0},
   {"ManifestEmbed", "manifest:embed", "", "true", 0},
+ {"GenerateDebugInformation", "DEBUG:FASTLINK", "", "DebugFastLink",
+ cmVS7FlagTable::CaseInsensitive},
   {"GenerateDebugInformation", "DEBUG", "", "Debug",
    cmVS7FlagTable::CaseInsensitive},
   {"MapExports", "MAPINFO:EXPORTS", "", "true", 0},
------------------------------------------------------------------------------

However, that does not account for the "Generate Full PDB files" part of your changes. Since that involves a new interface to support a new feature, this issue tracker entry is not a good place to discuss it. Please read CONTRIBUTING.rst at the top of the source tree and raise discussion of /debug:fastlink on the developer list:

  https://cmake.org/mailman/listinfo/cmake-developers [^]
(0040181)
Brad King   
2016-01-11 10:00   
I'm marking this issue as 'resolved' because the main problem has been addressed. Support for /debug:fastlink is a new feature that is best discussed separately. Thanks!
(0040194)
Thomas Laguzzi   
2016-01-11 15:32   
thanks! I wrote a follow up in the mailing.
BTW the "next" branch works good, and also the patch in the comment works good to enable FastLink.
If you commit it, only the PDB option will be remaining, but it's not *so* important
(0040195)
Brad King   
2016-01-11 15:55   
Re 0015894:0040194: Thanks. For reference, the new thread is here:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/15390 [^]
(0040275)
Brad King   
2016-01-20 10:26   
The change linked in 0015894:0040163 has been merged to 'release' and included in 3.4.2. That fixes the actual bug. Other changes discussed here are post-3.4 development and will be included in 3.5.
(0041243)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.