本文整理汇总了C++中ProjectBuildTarget::AddTargetDep方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectBuildTarget::AddTargetDep方法的具体用法?C++ ProjectBuildTarget::AddTargetDep怎么用?C++ ProjectBuildTarget::AddTargetDep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectBuildTarget
的用法示例。
在下文中一共展示了ProjectBuildTarget::AddTargetDep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateProjects
//.........这里部分代码省略.........
proj = projIt->second;
#if wxCHECK_VERSION(2, 9, 0)
Manager::Get()->GetLogManager()->DebugLog(F(_T("Project %s, %d dependencies"), proj._project->GetTitle().wx_str(), proj._dependencyList.GetCount()));
#else
Manager::Get()->GetLogManager()->DebugLog(F(_T("Project %s, %d dependencies"), proj._project->GetTitle().c_str(), proj._dependencyList.GetCount()));
#endif
for (i=0; i<proj._dependencyList.GetCount(); ++i) {
depIt = _projects.find(proj._dependencyList[i]);
if ( depIt != _projects.end()) { // dependency found
dep = depIt->second;
Manager::Get()->GetProjectManager()->AddProjectDependency(proj._project, dep._project);
// match target configurations
for (j=0; j<_workspaceConfigurations.GetCount(); ++j) {
ConfigurationMatchings::iterator configIt;
wxString wconfig;
wxString pconfig;
targetProj = 0;
targetDep = 0;
if (proj._configurations.empty()) { // msvc6
wconfig = _workspaceConfigurations[j];
targetProj = proj._project->GetBuildTarget(wconfig);
if (targetProj == 0) {
// look for a project config which is a substring of the workspace config
for (int k=0; k<proj._project->GetBuildTargetsCount(); ++k) {
pconfig = proj._project->GetBuildTarget(k)->GetTitle();
//Manager::Get()->GetLogManager()->DebugLog(_T("Test: %s <-> %s"), wconfig.c_str(), pconfig.c_str());
if (wconfig.StartsWith(pconfig) || pconfig.StartsWith(wconfig))
targetProj = proj._project->GetBuildTarget(k);
}
}
}
else { // msvc7
configIt = proj._configurations.find(_workspaceConfigurations[j]);
if (configIt != proj._configurations.end()) {
targetProj = proj._project->GetBuildTarget(configIt->second);
}
}
if (dep._configurations.empty()) { // msvc6
wconfig = _workspaceConfigurations[j];
targetDep = dep._project->GetBuildTarget(wconfig);
if (targetDep == 0) {
// look for a project config which is a substring of the workspace config
for (int k=0; k<dep._project->GetBuildTargetsCount(); ++k) {
pconfig = dep._project->GetBuildTarget(k)->GetTitle();
//Manager::Get()->GetLogManager()->DebugLog(_T("Test: %s <-> %s"), wconfig.c_str(), pconfig.c_str());
if (wconfig.StartsWith(pconfig) || pconfig.StartsWith(wconfig))
targetDep = dep._project->GetBuildTarget(k);
}
}
}
else { // msvc7
configIt = dep._configurations.find(_workspaceConfigurations[j]);
if (configIt != dep._configurations.end()) {
targetDep = dep._project->GetBuildTarget(configIt->second);
}
}
if ((targetDep==0) || (targetProj==0)) {
Manager::Get()->GetLogManager()->DebugLog(_T("ERROR: could not find targets"));
continue;
}
#if wxCHECK_VERSION(2, 9, 0)
Manager::Get()->GetLogManager()->DebugLog(F(_T("Match '%s' to '%s'"), targetProj->GetFullTitle().wx_str(), targetDep->GetFullTitle().wx_str()));
#else
Manager::Get()->GetLogManager()->DebugLog(F(_T("Match '%s' to '%s'"), targetProj->GetFullTitle().c_str(), targetDep->GetFullTitle().c_str()));
#endif
// now, update dependencies
TargetType type = targetDep->GetTargetType();
wxFileName fname;
if (type==ttDynamicLib) {
// targetDep->GetStaticLibFilename() do not work since it uses the filename instead of output filename
Compiler* compiler = CompilerFactory::GetCompiler(depIt->second._project->GetCompilerID());
wxString prefix = compiler->GetSwitches().libPrefix;
wxString suffix = compiler->GetSwitches().libExtension;
fname = targetDep->GetOutputFilename();
fname.SetName(prefix + fname.GetName());
fname.SetExt(suffix);
}
else if (type==ttStaticLib) fname = targetDep->GetOutputFilename();
targetProj->AddLinkLib(fname.GetFullPath());
targetProj->AddTargetDep(targetDep);
// TO REMOVE
wxString deps = targetProj->GetExternalDeps();
deps <<fname.GetFullPath() << _T(';');
targetProj->SetExternalDeps(deps);
// ---------
}
}
else {
Manager::Get()->GetLogManager()->DebugLog(_T("ERROR: dependency not found ") + proj._dependencyList[i]);
}
}
}
}