📄 msvc_makefile.cpp
字号:
info->push_back(build_info); }}void CMsvcProjectMakefile::GetResourceFiles(const SConfigInfo& config, list<string>* files) const{ string files_string = GetOpt(m_MakeFile, "AddToProject", "ResourceFiles", config); NStr::Split(files_string, LIST_SEPARATOR, *files);}//-----------------------------------------------------------------------------CMsvcProjectRuleMakefile::CMsvcProjectRuleMakefile(const string& file_path) :CMsvcProjectMakefile(file_path){}int CMsvcProjectRuleMakefile::GetRulePriority(const SConfigInfo& config) const{ string priority_string = GetOpt(m_MakeFile, "Rule", "Priority", config); if ( priority_string.empty() ) return 0; return NStr::StringToInt(priority_string);}//-----------------------------------------------------------------------------static string s_CreateRuleMakefileFilename(CProjItem::TProjType project_type, const string& requires){ string name = "Makefile." + requires; switch (project_type) { case CProjKey::eApp: name += ".app"; break; case CProjKey::eLib: name += ".lib"; break; case CProjKey::eDll: name += ".dll"; break; default: break; } return name + ".msvc";}CMsvcCombinedProjectMakefile::CMsvcCombinedProjectMakefile (CProjItem::TProjType project_type, const CMsvcProjectMakefile* project_makefile, const string& rules_basedir, const list<string> requires_list) :m_ProjectMakefile(project_makefile){ ITERATE(list<string>, p, requires_list) { const string& requires = *p; string rule_path = rules_basedir; rule_path = CDirEntry::ConcatPath(rule_path, s_CreateRuleMakefileFilename(project_type, requires)); TRule rule(new CMsvcProjectRuleMakefile(rule_path)); if ( !rule->IsEmpty() ) m_Rules.push_back(rule); }}CMsvcCombinedProjectMakefile::~CMsvcCombinedProjectMakefile(void){}#define IMPLEMENT_COMBINED_MAKEFILE_OPT(X) \string CMsvcCombinedProjectMakefile::X(const string& opt, \ const SConfigInfo& config) const \{ \ string prj_val = m_ProjectMakefile->X(opt, config); \ if ( !prj_val.empty() ) \ return prj_val; \ string val; \ int priority = 0; \ ITERATE(TRules, p, m_Rules) { \ const TRule& rule = *p; \ string rule_val = rule->X(opt, config); \ if ( !rule_val.empty() && priority < rule->GetRulePriority(config)) { \ val = rule_val; \ priority = rule->GetRulePriority(config); \ } \ } \ return val; \} IMPLEMENT_COMBINED_MAKEFILE_OPT(GetCompilerOpt)IMPLEMENT_COMBINED_MAKEFILE_OPT(GetLinkerOpt)IMPLEMENT_COMBINED_MAKEFILE_OPT(GetLibrarianOpt)IMPLEMENT_COMBINED_MAKEFILE_OPT(GetResourceCompilerOpt)bool CMsvcCombinedProjectMakefile::IsExcludeProject(bool default_val) const{ return m_ProjectMakefile->IsExcludeProject(default_val);}static void s_ConvertRelativePaths(const string& rule_base_dir, const list<string>& rules_paths_list, const string& project_base_dir, list<string>* project_paths_list){ project_paths_list->clear(); ITERATE(list<string>, p, rules_paths_list) { const string& rules_path = *p; string rules_abs_path = CDirEntry::ConcatPath(rule_base_dir, rules_path); string project_path = CDirEntry::CreateRelativePath(project_base_dir, rules_abs_path); project_paths_list->push_back(project_path); }}#define IMPLEMENT_COMBINED_MAKEFILE_VALUES(X) \void CMsvcCombinedProjectMakefile::X(const SConfigInfo& config, \ list<string>* values_list) const \{ \ list<string> prj_val; \ m_ProjectMakefile->X(config, &prj_val); \ if ( !prj_val.empty() ) { \ *values_list = prj_val; \ return; \ } \ list<string> val; \ int priority = 0; \ ITERATE(TRules, p, m_Rules) { \ const TRule& rule = *p; \ list<string> rule_val; \ rule->X(config, &rule_val); \ if ( !rule_val.empty() && priority < rule->GetRulePriority(config)) { \ val = rule_val; \ priority = rule->GetRulePriority(config); \ } \ } \ *values_list = val; \}#define IMPLEMENT_COMBINED_MAKEFILE_FILESLIST(X) \void CMsvcCombinedProjectMakefile::X(const SConfigInfo& config, \ list<string>* values_list) const \{ \ list<string> prj_val; \ m_ProjectMakefile->X(config, &prj_val); \ if ( !prj_val.empty() ) { \ *values_list = prj_val; \ return; \ } \ list<string> val; \ int priority = 0; \ string rule_base_dir; \ ITERATE(TRules, p, m_Rules) { \ const TRule& rule = *p; \ list<string> rule_val; \ rule->X(config, &rule_val); \ if ( !rule_val.empty() && priority < rule->GetRulePriority(config)) { \ val = rule_val; \ priority = rule->GetRulePriority(config); \ rule_base_dir = rule->m_ProjectBaseDir; \ } \ } \ s_ConvertRelativePaths(rule_base_dir, \ val, \ m_ProjectMakefile->m_ProjectBaseDir, \ values_list); \}IMPLEMENT_COMBINED_MAKEFILE_FILESLIST(GetAdditionalSourceFiles) IMPLEMENT_COMBINED_MAKEFILE_VALUES (GetAdditionalLIB)IMPLEMENT_COMBINED_MAKEFILE_FILESLIST(GetExcludedSourceFiles)IMPLEMENT_COMBINED_MAKEFILE_VALUES (GetExcludedLIB)IMPLEMENT_COMBINED_MAKEFILE_FILESLIST(GetAdditionalIncludeDirs)IMPLEMENT_COMBINED_MAKEFILE_FILESLIST(GetResourceFiles)void CMsvcCombinedProjectMakefile::GetCustomBuildInfo (list<SCustomBuildInfo>* info) const{ m_ProjectMakefile->GetCustomBuildInfo(info);}//-----------------------------------------------------------------------------string GetCompilerOpt(const IMsvcMetaMakefile& meta_file, const IMsvcMetaMakefile& project_file, const string& opt, const SConfigInfo& config){ string val = project_file.GetCompilerOpt(opt, config); if ( !val.empty() ) return val; return meta_file.GetCompilerOpt(opt, config);}string GetLinkerOpt(const IMsvcMetaMakefile& meta_file, const IMsvcMetaMakefile& project_file, const string& opt, const SConfigInfo& config){ string val = project_file.GetLinkerOpt(opt, config); if ( !val.empty() ) return val; return meta_file.GetLinkerOpt(opt, config);}string GetLibrarianOpt(const IMsvcMetaMakefile& meta_file, const IMsvcMetaMakefile& project_file, const string& opt, const SConfigInfo& config){ string val = project_file.GetLibrarianOpt(opt, config); if ( !val.empty() ) return val; return meta_file.GetLibrarianOpt(opt, config);}string GetResourceCompilerOpt(const IMsvcMetaMakefile& meta_file, const IMsvcMetaMakefile& project_file, const string& opt, const SConfigInfo& config){ string val = project_file.GetResourceCompilerOpt(opt, config); if ( !val.empty() ) return val; return meta_file.GetResourceCompilerOpt(opt, config);}END_NCBI_SCOPE/* * =========================================================================== * $Log: msvc_makefile.cpp,v $ * Revision 1000.2 2004/06/16 17:02:28 gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.15 * * Revision 1.15 2004/06/10 15:16:46 gorelenk * Changed macrodefines to be comply with GCC 3.4.0 . * * Revision 1.14 2004/06/07 13:50:29 gorelenk * Added implementation of classes * CMsvcProjectRuleMakefile and CMsvcCombinedProjectMakefile. * * Revision 1.13 2004/05/21 21:41:41 gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.12 2004/05/17 14:36:20 gorelenk * Implemented CMsvcMetaMakefile::GetPchUsageDefine . * * Revision 1.11 2004/05/10 19:52:52 gorelenk * Changed CreateMsvcProjectMakefileName. * * Revision 1.10 2004/05/10 14:27:04 gorelenk * Implemented IsPchEnabled and GetUsePchThroughHeader. * * Revision 1.9 2004/03/10 16:38:00 gorelenk * Added dll processing to function CreateMsvcProjectMakefileName. * * Revision 1.8 2004/02/23 20:42:57 gorelenk * Added support of MSVC ResourceCompiler tool. * * Revision 1.7 2004/02/23 18:50:31 gorelenk * Added implementation of GetResourceFiles member-function * of class CMsvcProjectMakefile. * * Revision 1.6 2004/02/20 22:53:25 gorelenk * Added analysis of ASN projects depends. * * Revision 1.5 2004/02/12 16:27:56 gorelenk * Changed generation of command line for datatool. * * Revision 1.4 2004/02/10 18:02:46 gorelenk * + GetAdditionalLIB. * + GetExcludedLIB - customization of depends. * * Revision 1.3 2004/02/06 23:14:59 gorelenk * Implemented support of ASN projects, semi-auto configure, * CPPFLAGS support. Second working version. * * Revision 1.2 2004/01/28 17:55:48 gorelenk * += For msvc makefile support of : * Requires tag, ExcludeProject tag, * AddToProject section (SourceFiles and IncludeDirs), * CustomBuild section. * += For support of user local site. * * Revision 1.1 2004/01/26 19:27:28 gorelenk * += MSVC meta makefile support * += MSVC project makefile support * * =========================================================================== */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -