[cmake-developers] toolset Clang 3.7 with Microsoft CodeGen (v140_clang_3_7) debug is broken

Forumer 4umer forumer at smartmobili.com
Fri Aug 12 08:59:38 EDT 2016


Le 2016-05-02 20:48, forumer at xxxx.com a écrit :
> Le 2016-05-02 20:41, Brad King a écrit :
>> On 05/02/2016 02:17 PM, forumer at xxxxx.com wrote:
>>> Don't know if it's the best place to report it but I am testing 
>>> nightly
>>> builds(3.5.20160429) to generate some projects
>>> for Visual Studio 2015 and the clang toolset now provided by 
>>> Microsoft.
>> 
>> Yes, this is the right place to report it, especially since this is
>> recent development.  For reference, support for this toolset was added
>> in a topic merged here:
>> 
>>   Merge topic 'vs-clang-cl'
>>   https://cmake.org/gitweb?p=cmake.git;a=commit;h=612a8b3b
>> 
>> based on discussion in this thread:
>> 
>>   [PATCH SET] Support of Clang/C2 compiler.
>>   
>> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/15902
>> 
>>> I have found some changes that seems to be necessary to be able to
>>> debug, here are the changes I have found:
>>> 
>>> 1) DebugInformationFormat should be set FullDebug, AdditionalOptions
>>> MUST BE removed and optimizations must be disabled
>>> 
>>> <ClCompile>
>>>     ... REMOVE AdditionalOptions ...
>>>     <DebugInformationFormat>FullDebug</DebugInformationFormat>
>>>     ...
>>>     <Optimization>Disabled</Optimization>
>>>     <OmitFramePointers>false</OmitFramePointers>
>>> </ClCompile>
>>> 
>>> 
>>> 2)GenerateDebugInformation must be set to true and 
>>> ProgramDataBaseFile
>>> must be empty because clang doesn't use pdb for now
>>> <Link>
>>> ...
>>>        <GenerateDebugInformation>true</GenerateDebugInformation>
>>> ...
>>>        <ProgramDataBaseFile>
>>>        </ProgramDataBaseFile>
>>> 
>>> </Link>
>> 
>> Mariusz, please take a look at this.
>> 
>> See also this hack:
>> 
>>   VS: Fix VS 2015 .vcxproj debug setting for older toolsets
>>   https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc422d27
>> 
>> Basically we need to have a different flag table for each possible
>> toolset.  Also it looks like additional special handling may be
>> needed for PDBs and perhaps other limitations of the Clang/C2
>> toolchain.
>> 
>> Thanks,
>> -Brad
> 
> Just a small update about what I wrote regarding AdditionalOptions, I
> found that it's not necessary to remove the whole line but only the
> -gline-tables-only parameter.
> 

Hi,

I have tested cmake 3.6.1 with the last release of the clang platform by 
Microsoft (v140_clang_c2)
and nothing has changed. By default cmake generates wrong projects with 
this toolset.
So could we fix it step by step:

In the next release of cmake could you please remove the 
-gline-tables-only (and maybe all the additional arguments you provide 
because Microsoft don't add them
when using Visual to generate projects)

Then if you have time please Disable Optimizations in Debug

and finally please set DebugInformationFormat for debug configurations.

For now I have to manually fix all my projects everytime I regenerate 
them and it's not very funny.

Thanks










More information about the cmake-developers mailing list