本文整理汇总了C++中SourceFile::GetLibraryPath方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceFile::GetLibraryPath方法的具体用法?C++ SourceFile::GetLibraryPath怎么用?C++ SourceFile::GetLibraryPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceFile
的用法示例。
在下文中一共展示了SourceFile::GetLibraryPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPath
void
Project::Link(void)
{
BString linkString;
if (TargetType() == TARGET_STATIC_LIB)
{
linkString = "ar rcs '";
linkString << GetPath().GetFolder() << "/" << GetTargetName() << "' ";
for (int32 i = 0; i < CountGroups(); i++)
{
SourceGroup *group = GroupAt(i);
for (int32 j = 0; j < group->filelist.CountItems(); j++)
{
SourceFile *file = group->filelist.ItemAt(j);
if (file->GetObjectPath(fBuildInfo).GetFullPath())
linkString << "'" << file->GetObjectPath(fBuildInfo).GetFullPath() << "' ";
}
}
}
else
{
linkString = "gcc -o '";
linkString << GetPath().GetFolder() << "/" << GetTargetName() << "' ";
for (int32 i = 0; i < CountGroups(); i++)
{
SourceGroup *group = GroupAt(i);
for (int32 j = 0; j < group->filelist.CountItems(); j++)
{
SourceFile *file = group->filelist.ItemAt(j);
if (file->GetObjectPath(fBuildInfo).GetFullPath())
linkString << "'" << file->GetObjectPath(fBuildInfo).GetFullPath() << "' ";
}
}
for (int32 i = 0; i < CountGroups(); i++)
{
SourceGroup *group = GroupAt(i);
for (int32 j = 0; j < group->filelist.CountItems(); j++)
{
SourceFile *file = group->filelist.ItemAt(j);
if (file->GetLibraryPath(fBuildInfo).GetFullPath())
linkString << "'" << file->GetLibraryPath(fBuildInfo).GetFullPath() << "' ";
}
}
for (int32 i = 0; i < CountLibraries(); i++)
{
SourceFile *file = LibraryAt(i);
if (!file)
continue;
BString filenamebase;
filenamebase = file->GetPath().GetBaseName();
if (filenamebase.FindFirst("lib") == 0)
filenamebase.RemoveFirst("lib");
linkString << "-l" << filenamebase << " ";
}
if (TargetType() == TARGET_DRIVER)
linkString << "/boot/develop/lib/x86/_KERNEL_ ";
linkString << "-L/boot/home/config/lib ";
switch (TargetType())
{
case TARGET_DRIVER:
{
linkString << "-Xlinker -nostdlib ";
break;
}
case TARGET_SHARED_LIB:
{
linkString << "-nostart -Xlinker -soname=" << GetTargetName() << " ";
break;
}
default:
{
// Application
linkString << "-Xlinker -soname=_APP_ ";
break;
}
}
}
linkString << " 2>&1";
BString errmsg;
PipeCommand(linkString.String(),errmsg);
STRACE(1,("Linking %s:\n%s\nErrors:\n%s\n",GetName(),linkString.String(),errmsg.String()));
if (errmsg.CountChars() > 0)
ParseLDErrors(errmsg.String(),fBuildInfo.errorList);
//.........这里部分代码省略.........