[Cmake-commits] [cmake-commits] king committed cmComputeLinkInformation.cxx 1.53 1.54
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Jul 28 08:08:03 EDT 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv22163/Source
Modified Files:
cmComputeLinkInformation.cxx
Log Message:
BUG: Always pass linker flags untouched
In cmComputeLinkInformation we recognize link options that look like
library file names, but pass flags starting in '-' through untouched.
This fixes the ordering of the check to recognize '-' flags first in
case the rest of the option looks like a library file name, as in the
case of "-l:libfoo.a".
Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.53
retrieving revision 1.54
diff -C 2 -d -r1.53 -r1.54
*** cmComputeLinkInformation.cxx 28 Jul 2009 12:07:52 -0000 1.53
--- cmComputeLinkInformation.cxx 28 Jul 2009 12:08:00 -0000 1.54
***************
*** 1185,1189 ****
// foo ==> -lfoo
// libfoo.a ==> -Wl,-Bstatic -lfoo
! std::string lib;
// Parse out the prefix, base, and suffix components of the
--- 1185,1210 ----
// foo ==> -lfoo
// libfoo.a ==> -Wl,-Bstatic -lfoo
!
! // Pass flags through untouched.
! if(item[0] == '-' || item[0] == '$' || item[0] == '`')
! {
! // if this is a -l option then we might need to warn about
! // CMP0003 so put it in OldUserFlagItems, if it is not a -l
! // or -Wl,-l (-framework -pthread), then allow it without a
! // CMP0003 as -L will not affect those other linker flags
! if(item.find("-l") == 0 || item.find("-Wl,-l") == 0)
! {
! // This is a linker option provided by the user.
! this->OldUserFlagItems.push_back(item);
! }
!
! // Restore the target link type since this item does not specify
! // one.
! this->SetCurrentLinkType(this->StartLinkType);
!
! // Use the item verbatim.
! this->Items.push_back(Item(item, false));
! return;
! }
// Parse out the prefix, base, and suffix components of the
***************
*** 1197,1200 ****
--- 1218,1222 ----
// libraries. On AIX a library with the name libfoo.a can be
// shared!
+ std::string lib;
if(this->ExtractSharedLibraryName.find(item))
{
***************
*** 1243,1266 ****
lib = this->ExtractAnyLibraryName.match(2);
}
- else if(item[0] == '-' || item[0] == '$' || item[0] == '`')
- {
- // if this is a -l option then we might need to warn about
- // CMP0003 so put it in OldUserFlagItems, if it is not a -l
- // or -Wl,-l (-framework -pthread), then allow it without a
- // CMP0003 as -L will not affect those other linker flags
- if(item.find("-l") == 0 || item.find("-Wl,-l") == 0)
- {
- // This is a linker option provided by the user.
- this->OldUserFlagItems.push_back(item);
- }
-
- // Restore the target link type since this item does not specify
- // one.
- this->SetCurrentLinkType(this->StartLinkType);
-
- // Use the item verbatim.
- this->Items.push_back(Item(item, false));
- return;
- }
else
{
--- 1265,1268 ----
More information about the Cmake-commits
mailing list