📄 msvc_dlls_info.cpp
字号:
string abs_path = CDirEntry::ConcatPath(lib_context.ProjectDir(), rel_path); abs_path = CDirEntry::NormalizePath(abs_path); GetApp().GetDllFilesDistr().RegisterInline (abs_path, CProjKey(CProjKey::eDll, dll->m_ID), CProjKey(CProjKey::eLib, lib.m_ID) ); } // Depends ITERATE(list<CProjKey>, p, lib.m_Depends) { const CProjKey& depend_id = *p; bool dll_hosted = (depend_id.Type() == CProjKey::eLib) && GetApp().GetDllsInfo().IsDllHosted(depend_id.Id()); if ( !dll_hosted ) { dll->m_Depends.push_back(depend_id); } else { dll->m_Depends.push_back (CProjKey(CProjKey::eDll, GetApp().GetDllsInfo().GetDllHost(depend_id.Id()))); } } dll->m_Depends.sort(); dll->m_Depends.unique(); // m_Requires copy(lib.m_Requires.begin(), lib.m_Requires.end(), back_inserter(dll->m_Requires)); dll->m_Requires.sort(); dll->m_Requires.unique(); // Libs 3-Party copy(lib.m_Libs3Party.begin(), lib.m_Libs3Party.end(), back_inserter(dll->m_Libs3Party)); dll->m_Libs3Party.sort(); dll->m_Libs3Party.unique(); // m_IncludeDirs copy(lib.m_IncludeDirs.begin(), lib.m_IncludeDirs.end(), back_inserter(dll->m_IncludeDirs)); dll->m_IncludeDirs.sort(); dll->m_IncludeDirs.unique(); // m_DatatoolSources copy(lib.m_DatatoolSources.begin(), lib.m_DatatoolSources.end(), back_inserter(dll->m_DatatoolSources)); dll->m_DatatoolSources.sort(); dll->m_DatatoolSources.unique(); // m_Defines copy(lib.m_Defines.begin(), lib.m_Defines.end(), back_inserter(dll->m_Defines)); dll->m_Defines.sort(); dll->m_Defines.unique(); {{ string makefile_name = SMakeProjectT::CreateMakeAppLibFileName(lib.m_SourcesBaseDir, lib.m_Name); CSimpleMakeFileContents makefile (CDirEntry::ConcatPath(lib.m_SourcesBaseDir, makefile_name)); CSimpleMakeFileContents::TContents::const_iterator p = makefile.m_Contents.find("NCBI_C_LIBS"); list<string> ncbi_clibs; if (p != makefile.m_Contents.end()) { SAppProjectT::CreateNcbiCToolkitLibs(makefile, &ncbi_clibs); dll->m_Libs3Party.push_back("NCBI_C_LIBS"); dll->m_Libs3Party.sort(); dll->m_Libs3Party.unique(); copy(ncbi_clibs.begin(), ncbi_clibs.end(), back_inserter(dll->m_NcbiCLibs)); dll->m_NcbiCLibs.sort(); dll->m_NcbiCLibs.unique(); } }} // m_NcbiCLibs copy(lib.m_NcbiCLibs.begin(), lib.m_NcbiCLibs.end(), back_inserter(dll->m_NcbiCLibs)); dll->m_NcbiCLibs.sort(); dll->m_NcbiCLibs.unique(); auto_ptr<CMsvcProjectMakefile> msvc_project_makefile = auto_ptr<CMsvcProjectMakefile> (new CMsvcProjectMakefile (CDirEntry::ConcatPath (lib.m_SourcesBaseDir, CreateMsvcProjectMakefileName(lib))));}void CreateDllBuildTree(const CProjectItemsTree& tree_src, CProjectItemsTree* tree_dst){ tree_dst->m_RootSrc = tree_src.m_RootSrc; FilterOutDllHostedProjects(tree_src, tree_dst); NON_CONST_ITERATE(CProjectItemsTree::TProjects, p, tree_dst->m_Projects) { list<CProjKey> new_depends; CProjItem& project = p->second; ITERATE(list<CProjKey>, n, project.m_Depends) { const CProjKey& depend_id = *n; bool dll_hosted = (depend_id.Type() == CProjKey::eLib) && GetApp().GetDllsInfo().IsDllHosted(depend_id.Id()); if ( !dll_hosted ) { new_depends.push_back(depend_id); } else { new_depends.push_back (CProjKey(CProjKey::eDll, GetApp().GetDllsInfo().GetDllHost(depend_id.Id()))); } } new_depends.sort(); new_depends.unique(); project.m_Depends = new_depends; } list<string> dll_ids; CreateDllsList(tree_src, &dll_ids); list<string> dll_depends_ids; CollectDllsDepends(dll_ids, &dll_depends_ids); copy(dll_depends_ids.begin(), dll_depends_ids.end(), back_inserter(dll_ids)); dll_ids.sort(); dll_ids.unique(); ITERATE(list<string>, p, dll_ids) { const string& dll_id = *p; CMsvcDllsInfo::SDllInfo dll_info; GetApp().GetDllsInfo().GetDllInfo(dll_id, &dll_info); CProjItem dll; s_InitalizeDllProj(dll_id, dll_info, &dll, tree_dst); ITERATE(list<string>, n, dll_info.m_Hosting) { const string& lib_id = *n; CProjectItemsTree::TProjects::const_iterator k = GetApp().GetWholeTree().m_Projects.find(CProjKey(CProjKey::eLib, lib_id)); if (k == GetApp().GetWholeTree().m_Projects.end()) { LOG_POST(Error << "No project " + lib_id + " hosted in dll : " + dll_id); continue; } const CProjItem& lib = k->second; s_AddProjItemToDll(lib, &dll); } tree_dst->m_Projects[CProjKey(CProjKey::eDll, dll_id)] = dll; }}void CreateDllsList(const CProjectItemsTree& tree_src, list<string>* dll_ids){ dll_ids->clear(); set<string> dll_set; ITERATE(CProjectItemsTree::TProjects, p, tree_src.m_Projects) { const CProjKey& proj_id = p->first; const CProjItem& project = p->second; bool dll_hosted = (proj_id.Type() == CProjKey::eLib) && GetApp().GetDllsInfo().IsDllHosted(proj_id.Id()); if ( dll_hosted ) { dll_set.insert(GetApp().GetDllsInfo().GetDllHost(proj_id.Id())); } } copy(dll_set.begin(), dll_set.end(), back_inserter(*dll_ids));}void CollectDllsDepends(const list<string>& dll_ids, list<string>* dll_depends_ids){ size_t depends_cnt = dll_depends_ids->size(); ITERATE(list<string>, p, dll_ids) { const string& dll_id = *p; CMsvcDllsInfo::SDllInfo dll_info; GetApp().GetDllsInfo().GetDllInfo(dll_id, &dll_info); ITERATE(list<string>, n, dll_info.m_Depends) { const string& depend_id = *n; if ( s_IsDllProject(depend_id) && find(dll_ids.begin(), dll_ids.end(), depend_id) == dll_ids.end() ) { dll_depends_ids->push_back(depend_id); } } } dll_depends_ids->sort(); dll_depends_ids->unique(); if ( !(dll_depends_ids->size() > depends_cnt) ) return; list<string> total_dll_ids(dll_ids); copy(dll_depends_ids->begin(), dll_depends_ids->end(), back_inserter(total_dll_ids)); total_dll_ids.sort(); total_dll_ids.unique(); CollectDllsDepends(total_dll_ids, dll_depends_ids);}END_NCBI_SCOPE/* * =========================================================================== * $Log: msvc_dlls_info.cpp,v $ * Revision 1000.4 2004/06/16 17:02:26 gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.19 * * Revision 1.19 2004/06/07 13:46:21 gorelenk * Class CMsvcDllsInfo separated from application config. * * Revision 1.18 2004/06/04 14:48:53 gorelenk * Changed dll_main location. * * Revision 1.17 2004/06/01 16:05:40 gorelenk * Changed implementation of s_AddProjItemToDll : added conditional branch for * processing lib_choice when library to add is available as a third-party . * * Revision 1.16 2004/05/26 17:58:03 gorelenk * Changed implementation of s_AddProjItemToDll - added registration of * inline source files. * * Revision 1.15 2004/05/21 21:41:41 gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.14 2004/05/19 14:24:32 gorelenk * Changed s_AddProjItemToDll - added code for registration of DLLs source * files. * * Revision 1.13 2004/04/20 14:14:24 gorelenk * Changed implementation of CMsvcDllsInfo::GetDllsList and * CMsvcDllsInfo::GetDllInfo . * * Revision 1.12 2004/04/13 17:07:52 gorelenk * Changed implementation of s_InitalizeDllProj . * * Revision 1.11 2004/03/23 14:39:41 gorelenk * Changed implementation of functions s_InitalizeDllProj and * CreateDllBuildTree to use whole build tree by GetApp().GetWholeTree(). * * Revision 1.10 2004/03/16 23:51:43 gorelenk * Changed implementation of s_AddProjItemToDll . * * Revision 1.9 2004/03/16 17:43:33 gorelenk * Addition of dllmain moved from s_AddProjItemToDll to s_InitalizeDllProj . * * Revision 1.8 2004/03/16 16:37:33 gorelenk * Changed msvc7_prj subdirs structure: Separated "static" and "dll" branches. * * Revision 1.7 2004/03/15 21:21:47 gorelenk * Added definition of function CollectDllsDepends. Changed implementation of * function CreateDllBuildTree. * * Revision 1.6 2004/03/12 20:20:00 gorelenk * Changed implementation of s_InitalizeDllProj - changed processing of * dll dependencies. * * Revision 1.5 2004/03/10 22:54:58 gorelenk * Changed implementation of s_InitalizeDllProj - added dependencies from * other dll. * * Revision 1.4 2004/03/10 16:36:39 gorelenk * Implemented functions FilterOutDllHostedProjects, * CreateDllBuildTree and CreateDllsList. * * Revision 1.3 2004/03/08 23:34:06 gorelenk * Implemented member-functions GelDllInfo, IsDllHosted, GetDllHost and * GetLibPrefixes of class CMsvcDllsInfo. * * Revision 1.2 2004/03/03 22:16:45 gorelenk * Added implementation of class CMsvcDllsInfo. * * Revision 1.1 2004/03/03 17:07:14 gorelenk * Initial revision. * * =========================================================================== */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -