Fix for (general, optimize, debug) link issue (was Re: kdelibs compile error)

Ralf Habacker ralf.habacker at freenet.de
Fri Aug 8 14:38:37 CEST 2008


Ralf Habacker schrieb:
> Bill Hoffman schrieb:
>   
>> Brad King has committed a fix for this in CVS CMake:
>> (If you could give it a try, I will merge it into the 2.6 branch for 
>> 2.6.2.)
>>     
> This does not help with the related issue. After a few more digging I 
> recognized that the following method
>
> cmComputeLinkDepends::AddLinkEntries(int depender_index,
>                                      std::vector<std::string> const& libs)
> {
>
> is called with a libs parameter containing optimized and debug terms - 
> the general terms are already been stripped anywhere before.
>
> I guess that this method should sort out the libraries not intended for 
> the given buildtype or this must be happen somewhere else - I haven't 
> found out yet.
>   
In case cmComputeLinkDepends::AddLinkEntries is the right place the 
append patch fixes this issue on windows (tested with "NMake Makefiles" 
generator)


BTW: Because there are already several places where the 
general/optimized/debug stuff is  used

[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmComputeLinkDepends.cxx]
Line 452 :     else if(*di == "general")
Line 570 :     else if(item == "general")
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmExportLibraryDependencies.cxx]
Line 130 :             ltValue = "general";
Line 164 :           ltEntry = "general";
Line 202 :     if(i->second != "general")
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmTarget.cxx]
Line 1323 :         dependencies += "general";
Line 1617 :         else if (l == "general")
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmTargetLinkLibrariesCommand.cxx]
Line 21 :   "general",
Line 71 :     else if(*i == "general")

[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmComputeLinkDepends.cxx]
Line 447 :     else if(*di == "optimized")
Line 474 :           else if(strcmp(val, "optimized") == 0)
Line 565 :     else if(item == "optimized")
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmExportLibraryDependencies.cxx]
Line 138 :             ltValue = "optimized";
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmLinkLibrariesCommand.cxx]
Line 44 :     else if (*i == "optimized")
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmTarget.cxx]
Line 1329 :         dependencies += "optimized";
Line 1613 :         else if (l == "optimized")
[E:\daten\kde\emerge-msvc-root\tmp\cmake-src-2.6.1\work\cmake-2.6.1\Source\cmTargetLinkLibrariesCommand.cxx]
Line 23 :   "optimized"
Line 62 :     else if(*i == "optimized")
Line 106 :         if(strcmp(linkTypeString, "optimized") == 0)

it may be good to have a common method which does this filtering for a 
given library vector - just a guess.

Ralf

>   
>> Update of /cvsroot/CMake/CMake/Source
>> In directory public:/mounts/ram/cvs-serv12085/Source
>>
>> Modified Files:
>>     cmTargetLinkLibrariesCommand.cxx
>>     cmTargetLinkLibrariesCommand.h
>> Log Message:
>> ENH: Tolerate repeated link library types
>>
>> The "debug", "optimized", and "general" link library type specifier
>> arguments to the target_link_library commands are sometimes repeated in
>> user code due to variable expansion and other complications.  Instead of
>> silently accepting the duplicates and trying to link to a bogus library
>> like "optimized.lib", warn and ignore the earlier specifiers.
>>
>>
>> Index: cmTargetLinkLibrariesCommand.h
>> ===================================================================
>> RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.h,v
>> retrieving revision 1.15
>> retrieving revision 1.16
>> RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.cxx,v
>> retrieving revision 1.25
>> retrieving revision 1.26
>>
>>
>> Thanks
>>
>> -Bill
>>     
>
> _______________________________________________
> Kde-windows mailing list
> Kde-windows at kde.org
> https://mail.kde.org/mailman/listinfo/kde-windows
>   

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cmComputeLinkDepends.cxx.patch
Url: http://mail.kde.org/pipermail/kde-windows/attachments/20080808/969eebfa/attachment.ksh 


More information about the Kde-windows mailing list