(list<string>, d, dependencies) {
64 if(
n!=
tree.m_Projects.
end()) {
72 "should be built after: "<< dep_item.
m_MkName);
84 PLibExclude(
const string& prj_name,
constlist<string>& excluded_lib_ids)
87 copy(excluded_lib_ids.begin(), excluded_lib_ids.end(),
108 const string& projname,
111 stringfname =
"Makefile."+ projname;
118 stringfname_msvc2(fname_msvc);
122fname_msvc +=
".msvcproj";
124fname_msvc2 +=
".in";
155 else if(
CDirEntry(fname_dll).Exists() )
157 else if(
CDirEntry(fname_app).Exists() )
167 "Makefile not found");
172 "Makefile not found");
177 "Makefile not found");
182 "Makefile not found");
187 "Makefile not found");
196 returnname ==
"Makefile.in";
239 boolmsvc_empty = msvc_prj.
IsEmpty();
243p->second.m_Contents) {
245 const string&
key=
n->first;
246list<string>& values =
n->second;
247 boolcppflags =
key==
"CPPFLAGS";
251 boolmodified =
false;
252list<string> new_vals;
253list<string> redef_values;
254modified = msvc_prj.
Redefine(values,redef_values);
258 const string&
val= *k;
259 if(cppflags &&
site.IsCppflagDescribed(
val)) {
261new_vals.push_back(
val);
267new_vals.push_back(
val);
272list<string> resolved_def;
274resolver.
Resolve(
val, &resolved_def, p->second);
275 if( resolved_def.empty() ) {
277new_vals.push_back(val_define);
281 ITERATE(list<string>,
l, resolved_def) {
282 const string& define = *
l;
285 stringresolved_def_str;
286list<string> libchoices_includes ;
287 site.GetLibChoiceIncludes(stripped, &libchoices_includes);
288 if(!libchoices_includes.empty()) {
289resolved_def_str =
NStr::Join( libchoices_includes,
" ");
291resolved_def_str =
site.GetDefinesEntry(stripped);
293 if( !resolved_def_str.empty() ) {
294defs_resolved[define] = resolved_def_str;
295list<string> resolved_defs;
300 copy(resolved_defs.begin(),
302back_inserter(new_vals));
304msvc_prj.
Append(new_vals,resolved_defs);
308list<string> components;
309 site.GetComponents(stripped, &components);
310 if(!components.empty()) {
311defs_resolved[define] =
"Component= "+
NStr::Join( components,
", ");
313defs_unresolved.
insert(define);
316new_vals.push_back(define);
318msvc_prj.
Append(new_vals,define);
327 stringresolved_def_str =
site.GetDefinesEntry(stripped);
328 if(resolved_def_str ==
" ") {
329resolved_def_str.erase();
334new_vals.push_back( def);
336msvc_prj.
Append(new_vals,def);
340new_vals.push_back(define);
342msvc_prj.
Append(new_vals,define);
351msvc_prj.
Redefine(new_vals,redef_values);
352values = redef_values;
358 if(!defs_resolved.
empty()) {
361 r!= defs_resolved.
end(); ++
r) {
368 PTB_INFO(
"Resolved macro definitions: "<< s);
370 if(!defs_unresolved.
empty()) {
373u != defs_unresolved.
end(); ++u) {
378 "Unresolved macro definitions:"<< s);
385 size_ttoken_pos = flag.find(token);
386 if(token_pos !=
NPOS&&
387token_pos + token.length() < flag.length()) {
388 returnflag.substr(token_pos + token.length());
395 const string& source_base_dir,
396list<string>* include_dirs)
398include_dirs->clear();
399 ITERATE(list<string>, p, cpp_flags) {
400 const string& flag = *p;
406 if( !token_val.empty() ) {
413include_dirs->push_back(dir);
416 if( !token_val.empty() ) {
421include_dirs->push_back(dir);
426 if( !token_val.empty() || flag ==
"-I$(srcdir)") {
433include_dirs->push_back(dir);
438 if( !token_val.empty() && token_val[0] !=
'$'&& token_val[0] !=
'@'&& token_val[0] !=
':') {
441include_dirs->push_back(dir);
448 if( !dir_all.empty() ) {
449list<string> dir_list;
451 ITERATE(list<string>, dir_item, dir_list) {
452 const string& dir = *dir_item;
454include_dirs->push_back(dir);
457<< flag <<
" = "<< dir <<
": " 458<< dir <<
" not found");
459include_dirs->push_back(dir);
466include_dirs->push_back(d);
482list<string> libchoices_abs_includes ;
484&libchoices_abs_includes);
485 ITERATE(list<string>,
n, libchoices_abs_includes) {
486 const string& dir = *
n;
487 if( !dir.empty() ) {
488include_dirs->push_back(dir);
493include_dirs->sort();
494include_dirs->unique();
499list<string>* defines)
503 ITERATE(list<string>, p, cpp_flags) {
504 const string& flag = *p;
506defines->push_back(flag.substr(2));
513 constlist<string>& libs_flags,
constlist<string>& expected_flags,
514list<string>* libs_list,
const string* mkname)
518list<string> unkflags;
519list<CProjKey> libs3;
520 ITERATE(list<string>, p, libs_flags) {
530 if(liborder_found && find(
531 GetApp().m_LibraryOrder[*mkname].begin(),
532 GetApp().m_LibraryOrder[*mkname].end(), flag.substr(2)) !=
533 GetApp().m_LibraryOrder[*mkname].end()) {
539 done.insert(flag.substr(2));
541 if(p != libs_flags.end()) {
547unkflags.push_back(flag);
551 if(
GetApp().m_AddMissingDep) {
552 ITERATE(list<string>, p, expected_flags) {
553 const string& flag = *p;
555 if(
done.find(flag.substr(2)) ==
done.end()) {
557 done.insert(flag.substr(2));
561 if(
done.find(flag) ==
done.end()) {
567 if(find(unkflags.begin(), unkflags.end(), flag) == unkflags.end()) {
568unkflags.push_back(flag);
574 if(mkname !=
NULL&& !
GetApp().IsScanningWholeTree() && !libs3.empty()) {
575list<string> liborder;
577liborder.push_back(
"");
580 if(!liborder.empty()) {
582 ITERATE( list<string>, s, liborder) {
585 if(libs_list && find(libs_list->begin(), libs_list->end(), *s) == libs_list->end()) {
589libs_list->push_back(*s);
714p = makein_contents.
m_Contents.
find(
"EXPENDABLE_UNIX_PROJ");
731(
const string& base_dir,
732 const string& projname,
738 stringfname =
"Makefile."+ projname;
749fname +=
".msvcproj";
759 constlist<string> files,
760list<string>* full_pathes)
762 ITERATE(list<string>, p, files) {
764full_pathes->push_back(full_path);
771 const string& branch,
775 if(all_dep.
find(branch) != all_dep.
end()) {
779 if(source_flags.find(branch) != source_flags.end()) {
785 if(source_dep.find(branch) != source_dep.end()) {
786 const set<string>& branches(source_dep.find(branch)->second);
794list<CProjKey>& depends_ids_arg,
const string& mkname, list<string>& liborder,
795 const set<string>* libs_3party, list<string>* expected_3party)
797 if(depends_ids_arg.empty()) {
800 if(
GetApp().m_GraphDepPrecedes.empty()) {
804list<string> warnings;
805list<string> original;
806list<string> duplicates;
807list<string> missing;
811list<CProjKey> depends_ids( depends_ids_arg);
813 for(list<CProjKey>::const_iterator p = depends_ids.begin();
814p != depends_ids.end(); ++p) {
815 for(list<CProjKey>::const_iterator
i= p;
816++
i!= depends_ids.end();) {
818duplicates.push_back(
i->Id());
822original.push_back(p->Id());
825 if(expected_3party !=
nullptr) {
827expected_3party->push_back(*s);
834list<CProjKey>::const_iterator p = depends_ids.begin();
835 for(; p != depends_ids.end(); ++p) {
836 if(p->Id() ==
id) {
840 if(p == depends_ids.end()) {
841 for(p = depends_ids.begin(); p != depends_ids.end(); ++p) {
846 if(p == depends_ids.end()) {
847 if(libs_3party ==
nullptr||
848libs_3party->
find(
id) == libs_3party->
end()) {
852missing.push_back(
id);
853missing_suffix[id] = s_suffix;
855}
else if(expected_3party !=
nullptr) {
857expected_3party->push_back(
id);
859expected_3party->push_back(
"-l"+
id);
865 if(!missing.empty()) {
866warnings.push_back(
"missing dependencies: "+
NStr::Join(missing,
","));
868 ITERATE( list<string>, m, missing) {
873 if(!duplicates.empty()) {
874warnings.push_back(
"duplicate dependencies: "+
NStr::Join(duplicates,
","));
878 boolfix = (!liborder.empty() && liborder.begin()->empty()) ||
879!duplicates.
empty() || depends_ids_arg.size() != depends_ids.size();
885 for(list<CProjKey>::const_iterator p = depends_ids.begin();
886p != depends_ids.end(); ++p) {
888 boolobsolete =
false;
898projlibs.
erase(*s);
899projlibs.
insert(p->Id());
900warnings.push_back(
"obsolete library: "+ *s +
" already included into "+ p->Id());
905projlibs.
erase(p->Id());
907warnings.push_back(
"obsolete library: "+ p->Id() +
" already included into "+ *s);
910 if(!wrong.empty()) {
913 if(find(missing.begin(), missing.end(), p->Id()) == missing.end()) {
914warnings.push_back(
"wrong library order: "+ p->Id() +
" should precede "+
NStr::Join(wrong,
","));
918libsofar.
insert(p->Id());
920projlibs.
insert(p->Id());
925list<string> unknown;
928unknown.push_back(*p);
931 if(!unknown.empty()) {
933warnings.push_back(
"unknown libraries: "+
NStr::Join(unknown,
","));
940liborder.push_back(*p);
943vector< list<string> > recommend;
946 while(recommend.size() < rank+1) {
948recommend.push_back(
t);
950recommend[rank].push_back(*p);
953 for(
size_t a= recommend.size();
a!= 0; --
a) {
954advice.insert(advice.end(), recommend[
a-1].begin(), recommend[
a-1].end());
957warnings.push_back(
"present library order: "+
NStr::Join(original,
","));
958warnings.push_back(
"recommended library order: "+
NStr::Join(advice,
","));
960list<string> advice_full;
961 ITERATE( list<string>,
a, advice) {
962 for(list<CProjKey>::const_iterator p = depends_ids.begin();
963p != depends_ids.end(); ++p) {
964 if(*
a== p->Id()) {
965advice_full.push_back( p->FullId());
970liborder = advice_full;
974 if(!warnings.empty() && expected_3party !=
nullptr) {
975 if(libs_3party ==
nullptr) {
976warnings.push_front(
"====== Library order warnings (3rd party libs) ======");
978warnings.push_front(
"====== Library order warnings (toolkit libs) ======");
996 for(list<CProjKey>::const_iterator p = depends_ids.begin();
997p != depends_ids.end(); ++p) {
1001wrong.push_back(*s);
1005 "obsolete library: "<< *s <<
" already included into "<< p->Id());
1009 "obsolete library: "<< p->Id() <<
" already included into "<< *s);
1012 if(!wrong.empty()) {
1014 "wrong library order: "<< p->Id() <<
" should precede "<<
NStr::Join(wrong,
","));
1016libsofar.
insert(p->Id());
1020 if(depends_ids_arg.size() != depends_ids.size()) {
1021depends_ids_arg = depends_ids;
1026list<CProjKey>* depends_ids,
1027 const string* mkname,
1028list<string>* expected_3party)
1030list<string> depends_libs;
1034 ITERATE(list<string>, p, depends_libs) {
1041list<string> resolved_def;
1043 ITERATE(list<string>,
r, resolved_def) {
1045 if(!
site.IsLibWithChoice(
id) ||
1051}
else if(
id.
empty()) {
1053 if(!
site.IsLibWithChoice(
id) ||
1060 if(mkname !=
NULL&& !
GetApp().IsScanningWholeTree()) {
1062&
GetApp().m_3PartyLibs, expected_3party);
1065depends_ids->sort();
1066depends_ids->unique();
1070list<string>& depends_libs)
1073 ITERATE(list<string>, p, depends) {
1074 const string&
id= *p;
1075 if(
id[0] ==
'#') {
1078 stringlib =
site.ProcessMacros(
id,
false);
1080depends_libs.push_back(lib);
1088depends_libs.push_back(
r->substr(2));
1090depends_libs.push_back(*
r);
1094depends_libs.push_back(
id);
1104string::size_type end = define.find(
"@",1);
1105 returnend != string::npos && ( ++end == define.size() || define[end] ==
'\0');
1115define.substr(1, define.length() - 2):
"";
1120 return count(define.begin(), define.end(),
'@') > 1;
1125string::size_type start, end;
1126start = define.find(
"@");
1127end = define.find(
"@",start+1);
1128 if(end == string::npos) {
1132 returndefine.substr(start,end-start+1);
1137list<string>* libs_list)
1144 constlist<string>& values = k->second;
1146 ITERATE(list<string>, p, values) {
1147 const string&
val= *p;
1149 stringlib_id =
val.substr(2);
1150libs_list->push_back(lib_id);
1152libs_list->push_back(
val);
1157libs_list->unique();
1161 const string& proj_name,
1162 const string& applib_mfilepath,
1168 if(m == makeapp.
end()) {
1180 stringfull_makefile_path = applib_mfilepath;
1185 if(k == makefile.
m_Contents.
end() || k->second.empty()) {
1186 if(
GetApp().IsScanningWholeTree()) {
1188 "APP is not specified: "<< full_makefile_name);
1191 "APP is not specified: "<< full_makefile_name);
1195 stringproj_id = k->second.front();
1199 if(z !=
tree->m_Projects.
end()) {
1202 "Application "<< proj_id <<
" already defined at " 1203<<
tree->m_Projects[proj_key].m_SourcesBaseDir);
1217 if(
GetApp().IsScanningWholeTree()) {
1219 "SRC is not specified: "<< full_makefile_name);
1222 "SRC is not specified: "<< full_makefile_name);
1230source_base_dir, k->second);
1231list<string> sources;
1238source_base_dir, k->second);
1239list<string> unix_sources;
1240unix_src_resolver.
ResolveTo(&unix_sources);
1241 copy(unix_sources.begin(), unix_sources.end(), back_inserter(sources));
1246list<string> depends;
1257 ITERATE(list<string>,
i, k->second) {
1263depends.push_back( *
i);
1271list<string> added_depends;
1274list<string> excluded_depends;
1277list<string> adj_depends(depends);
1278 copy(added_depends.begin(),
1279added_depends.end(), back_inserter(adj_depends));
1284list<string> expected_3party;
1285list<CProjKey> depends_ids;
1287&applib_mfilepath, &expected_3party);
1289list<CProjKey> unconditional_depends_ids;
1290k = m->second.m_Contents.find(
"USR_DEP");
1291 if(k != m->second.m_Contents.end()) {
1292 constlist<string> depends = k->second;
1294 copy(unconditional_depends_ids.begin(),
1295unconditional_depends_ids.end(), back_inserter(depends_ids));
1297k = m->second.m_Contents.find(
"MSVC_DEP");
1298 if(k != m->second.m_Contents.end()) {
1299 constlist<string> deps = k->second;
1300 ITERATE(list<string>, p, deps) {
1308list<string> req_lst;
1311project_makefile.
Redefine(req_lst,reqs);
1315list<string> libs_3_party;
1324 if(k != makefile.
m_Contents.
end() || !expected_3party.empty()) {
1325list<string> libs_flags;
1327libs_flags = k->second;
1333list<string> include_dirs;
1334list<string> defines;
1337 constlist<string>& cpp_flags = k->second;
1339source_base_dir, &include_dirs);
1342 boolstyle_objcpp =
false;
1345 constlist<string>& cxx_flags = k->second;
1346style_objcpp = find(cxx_flags.begin(), cxx_flags.end(),
"objective-c++") != cxx_flags.end();
1351list<string> ncbi_clibs;
1353libs_3_party.push_back(
"NCBI_C_LIBS");
1372project.
m_MkName= applib_mfilepath;
1376list<CDataToolGeneratedSrc> datatool_sources;
1379 constlist<string> datatool_src_list = k->second;
1380 ITERATE(list<string>,
i, datatool_src_list) {
1382 const string& src = *
i;
1384 stringsource_file_path =
1387 if(
CDirEntry(source_file_path +
".asn").Exists() )
1388source_file_path +=
".asn";
1389 else if(
CDirEntry(source_file_path +
".dtd").Exists() )
1390source_file_path +=
".dtd";
1391 else if(
CDirEntry(source_file_path +
".xsd").Exists() )
1392source_file_path +=
".xsd";
1396 if( !data_tool_src.
IsEmpty() )
1397datatool_sources.push_back(data_tool_src);
1400 if( !datatool_sources.empty() ) {
1410 GetApp().GetProjectTreeInfo().m_Src, source_base_dir);
1413check_dir.erase(check_dir.size()-1,1);
1415 stringcheck_testname(proj_name);
1416 stringcheck_appname(proj_id);
1420 if( k != makefile.
m_Contents.
end() && !k->second.empty() ) {
1423 stringcheck_timeout(
"200");
1425 if( k != makefile.
m_Contents.
end() && !k->second.empty() ) {
1426check_timeout =
NStr::Join(k->second,
" ");
1429 boolcheck_requires_ok =
true;
1430 stringcheck_requires;
1432 if( k != makefile.
m_Contents.
end() && !k->second.empty() ) {
1434 ITERATE(list<string>, p, k->second) {
1435 if( !
GetApp().GetSite().IsProvided(*p) ) {
1436check_requires_ok =
false;
1440check_requires =
NStr::Join(k->second,
" ");
1442 if(check_requires_ok) {
1444 if( k != makefile.
m_Contents.
end() && !k->second.empty() ) {
1445 if(!check_requires.empty()) {
1446check_requires +=
" ";
1448check_requires +=
NStr::Join(k->second,
" ");
1452 stringcheck_authors;
1453list<string> lst_authors;
1456check_authors =
NStr::Join(lst_authors,
" ");
1460 if( k != makefile.
m_Contents.
end() && !k->second.empty() ) {
1461check_authors =
NStr::Join(k->second,
" ");
1471 constlist<string> check_cmd_list = k->second;
1473 ITERATE(list<string>,
i, check_cmd_list) {
1475string::size_type
n= check_cmd.find(
test_name);
1476 if(
n!= string::npos) {
1478check_cmd = check_cmd.substr(0,
n);
1496 if(find(reqs.begin(), reqs.end(),
"internal") == reqs.end() ) {
1499project.
m_ProjTags.push_back(
"internal");
1504list<string> pch_lst;
1507project.
m_Pch= pch_lst.front();
1511 tree->m_Projects[proj_key] = project;
1519 const string& proj_name,
1520 const string& applib_mfilepath,
1526 if(m == makelib.
end()) {
1538 stringfull_makefile_path = applib_mfilepath;
1542k = m->second.m_Contents.find(
"LIB");
1545m->second.m_Contents.find(
"STATIC_LIB");
1546 if(tmp_k != m->second.m_Contents.end()) {
1550 if(k == m->second.m_Contents.end() ||
1551k->second.empty()) {
1552 if(
GetApp().IsScanningWholeTree()) {
1554 "LIB is not specified: "<< full_makefile_name);
1557 "LIB is not specified: "<< full_makefile_name);
1561 stringproj_id = k->second.front();
1565 if(z !=
tree->m_Projects.
end()) {
1568 "Library "<< proj_id <<
" already defined at " 1569<<
tree->m_Projects[proj_key].m_SourcesBaseDir);
1582k = m->second.m_Contents.find(
"SRC");
1583 if(k == m->second.m_Contents.end()) {
1584 if(
GetApp().IsScanningWholeTree()) {
1586 "SRC is not specified: "<< full_makefile_name);
1589 "SRC is not specified: "<< full_makefile_name);
1597source_base_dir, k->second);
1598list<string> sources;
1602k = m->second.m_Contents.find(
"UNIX_SRC");
1603 if(k != m->second.m_Contents.end()) {
1605source_base_dir, k->second);
1606list<string> unix_sources;
1607unix_src_resolver.
ResolveTo(&unix_sources);
1608 copy(unix_sources.begin(), unix_sources.end(), back_inserter(sources));
1613list<CProjKey> depends_ids;
1614list<CProjKey> unconditional_depends_ids;
1615k = m->second.m_Contents.find(
"ASN_DEP");
1616 if(k != m->second.m_Contents.end()) {
1617 constlist<string> depends = k->second;
1619 copy(unconditional_depends_ids.begin(),
1620unconditional_depends_ids.end(), back_inserter(depends_ids));
1622k = m->second.m_Contents.find(
"USR_DEP");
1623 if(k != m->second.m_Contents.end()) {
1624 constlist<string> depends = k->second;
1626 copy(unconditional_depends_ids.begin(),
1627unconditional_depends_ids.end(), back_inserter(depends_ids));
1629k = m->second.m_Contents.find(
"MSVC_DEP");
1630 if(k != m->second.m_Contents.end()) {
1631 constlist<string> deps = k->second;
1632 ITERATE(list<string>, p, deps) {
1639k = m->second.m_Contents.find(
"LIB_OR_DLL");
1640 if(k != m->second.m_Contents.end()) {
1641lib_or_dll = k->second.front();
1648 boolneed_dll = (!dll_host.empty() &&
1653list<string> req_lst;
1654 if(m->second.CollectValues(
"REQUIRES",req_lst,
1658project_makefile.
Redefine(req_lst,reqs);
1662list<string> include_dirs;
1663list<string> defines;
1664k = m->second.m_Contents.find(
"CPPFLAGS");
1665 if(k != m->second.m_Contents.end()) {
1666 constlist<string>& cpp_flags = k->second;
1668source_base_dir, &include_dirs);
1672 boolstyle_objcpp =
false;
1673k = m->second.m_Contents.find(
"CXXFLAGS");
1674 if(k != m->second.m_Contents.end()) {
1675 constlist<string>& cxx_flags = k->second;
1676style_objcpp = find(cxx_flags.begin(), cxx_flags.end(),
"objective-c++") != cxx_flags.end();
1679 boolisbundle =
false;
1680k = m->second.m_Contents.find(
"DLL_TYPE");
1681 if(k != m->second.m_Contents.end() && k->second.front() ==
"plugin") {
1687list<string> dll_depends;
1688k = m->second.m_Contents.find(
"DLL_LIB");
1689 if(
GetApp().m_AllDllBuild) {
1691m->second.m_Contents.find(
"DLL_DLIB");
1692 if(tmp_k != m->second.m_Contents.end()) {
1696 if(k != m->second.m_Contents.end()) {
1697 ITERATE(list<string>,
i, k->second) {
1699dll_depends.push_back(
1703dll_depends.push_back(*
i);
1707list<string> expected_3party;
1708list<CProjKey> dll_depends_ids;
1710need_dll ? &applib_mfilepath :
NULL,
1711need_dll ? &expected_3party :
NULL);
1712 copy(dll_depends_ids.begin(),
1713dll_depends_ids.end(),
1714back_inserter(depends_ids));
1719list<string> libs_3_party;
1720k = m->second.m_Contents.find(
"LIBS");
1723m->second.m_Contents.find(
"STATIC_LIBS");
1724 if(tmp_k != m->second.m_Contents.end()) {
1728 if(k != m->second.m_Contents.end() || !expected_3party.empty()) {
1729list<string> libs_flags;
1730 if(k != m->second.m_Contents.end()) {
1731libs_flags = k->second;
1734need_dll ? &applib_mfilepath :
NULL);
1752(
tree->m_Projects[proj_key]).m_StyleObjcpp = style_objcpp;
1753(
tree->m_Projects[proj_key]).m_MkName = applib_mfilepath;
1756(
tree->m_Projects[proj_key]).m_IsMetallib =
true;
1760 if(k != m->second.m_Contents.end()) {
1761(
tree->m_Projects[proj_key]).m_ExportHeaders = k->second;
1763k = m->second.m_Contents.find(
"PACKAGE_EXPORT");
1764 if(k != m->second.m_Contents.end()) {
1765(
tree->m_Projects[proj_key]).m_ExportHeadersDest = k->second.front();
1767list<string> lst_watchers;
1768 if(m->second.CollectValues(
"WATCHERS", lst_watchers,
1770 tree->m_Projects[proj_key].m_Watchers =
NStr::Join(lst_watchers,
" ");
1773 tree->m_Projects[proj_key].m_ProjTags.push_back(
"lib");
1774 if(find(reqs.begin(), reqs.end(),
"internal") == reqs.end() ) {
1775 tree->m_Projects[proj_key].m_ProjTags.push_back(
"public");
1777 tree->m_Projects[proj_key].m_ProjTags.push_back(
"internal");
1779m->second.CollectValues(
"PROJ_TAG",
tree->m_Projects[proj_key].m_ProjTags,
1782list<string> pch_lst;
1783 if(m->second.CollectValues(
"USE_PCH", pch_lst,
1785 tree->m_Projects[proj_key].m_Pch = pch_lst.front();
1789 tree->m_Projects[proj_key].m_DllHost = dll_host;
1791 if(
tree->m_Projects.find(proj_dll) ==
tree->m_Projects.
end()) {
1795item_dll.
m_Name= dll_host;
1796item_dll.
m_ID= dll_host;
1798item_dll.
m_Name= proj_name;
1799item_dll.
m_ID= proj_id;
1808item_dll.
m_MkName= applib_mfilepath;
1812 tree->m_Projects[proj_dll] = item_dll;
1815 ITERATE(list<CProjKey>, u, unconditional_depends_ids) {
1816(
tree->m_Projects[proj_key]).m_UnconditionalDepends.insert( *u);
1822 const string& source_base_dir,
1823 const string& proj_name,
1824 const string& proj_id,
1828 stringspec_proj_name = proj_name;
1829 stringspec_proj_id = proj_id;
1831list<string> s_empty;
1832list<CProjKey> d_empty;
1852 stringspec_proj_name = name;
1855list<string> s_empty;
1856list<CProjKey> d_empty;
1875 const string& proj_name,
1876 const string& applib_mfilepath,
1882 if(m == makedll.
end()) {
1890k = m->second.m_Contents.find(
"DLL");
1891 if(k == m->second.m_Contents.end() ||
1892k->second.empty()) {
1894<<
".dll at "<< applib_mfilepath);
1897 stringproj_id = k->second.front();
1901 if(z !=
tree->m_Projects.
end()) {
1905 stringfull_makefile_path = applib_mfilepath;
1907 "DLL "<< proj_id <<
" already defined at " 1908<<
tree->m_Projects[proj_key].m_SourcesBaseDir);
1922list<string> include_dirs;
1923list<string> defines;
1924k = m->second.m_Contents.find(
"CPPFLAGS");
1925 if(k != m->second.m_Contents.end()) {
1926 constlist<string>& cpp_flags = k->second;
1928source_base_dir, &include_dirs);
1932 boolstyle_objcpp =
false;
1933k = m->second.m_Contents.find(
"CXXFLAGS");
1934 if(k != m->second.m_Contents.end()) {
1935 constlist<string>& cxx_flags = k->second;
1936style_objcpp = find(cxx_flags.begin(), cxx_flags.end(),
"objective-c++") != cxx_flags.end();
1939list<CProjKey> depends_ids;
1940k = m->second.m_Contents.find(
"DEPENDENCIES");
1941 if(k != m->second.m_Contents.end()) {
1942 constlist<string> depends = k->second;
1947reqs.push_back(
"DLL");
1949list<string> sources;
1950list<string> libs_3_party;
1965 tree->m_Projects[proj_key].m_External =
true;
1966 tree->m_Projects[proj_key].m_StyleObjcpp = style_objcpp;
1967 tree->m_Projects[proj_key].m_MkName = applib_mfilepath;
1970k = m->second.m_Contents.find(
"HOSTED_LIBS");
1971 if(k != m->second.m_Contents.end()) {
1972 tree->m_Projects[proj_key].m_HostedLibs = k->second;
1974k = m->second.m_Contents.find(
"DLL_TYPE");
1975 if(k != m->second.m_Contents.end() && k->second.front() ==
"plugin") {
1976 tree->m_Projects[proj_key].m_IsBundle =
true;
1978list<string> lst_watchers;
1979 if(m->second.CollectValues(
"WATCHERS", lst_watchers,
1981 tree->m_Projects[proj_key].m_Watchers =
NStr::Join(lst_watchers,
" ");
1983 tree->m_Projects[proj_key].m_ProjTags.push_back(
"dll");
1984m->second.CollectValues(
"PROJ_TAG",
tree->m_Projects[proj_key].m_ProjTags,
1991 const string& proj_name,
1992 const string& applib_mfilepath,
2024 if( p != makeapp.
end() ) {
2032p = makelib.
find(applib_mfilepath);
2033 if( p != makelib.
end() ) {
2046 const string& proj_name,
2047 const string& applib_mfilepath,
2060proj_name, applib_mfilepath, makelib,
tree, maketype) :
2062proj_name, applib_mfilepath, makeapp,
tree, maketype);
2063 if( proj_id.
Id().empty() )
2067 if(p ==
tree->m_Projects.
end()) {
2075 switch(makeinfo.
m_Type) {
2077 if(
CDirEntry(source_file_path +
".asn").Exists() )
2078source_file_path +=
".asn";
2081 if(
CDirEntry(source_file_path +
".dtd").Exists() )
2082source_file_path +=
".dtd";
2085 if(
CDirEntry(source_file_path +
".xsd").Exists() )
2086source_file_path +=
".xsd";
2089 if(
CDirEntry(source_file_path +
".wsdl").Exists() )
2090source_file_path +=
".wsdl";
2093 if(
CDirEntry(source_file_path +
".jsd").Exists() )
2094source_file_path +=
".jsd";
2097 if(
CDirEntry(source_file_path +
".proto").Exists() )
2098source_file_path +=
".proto";
2103 if( !
CDirEntry(source_file_path).Exists() ) {
2107<<
"Data specification for ASN project not found: "<< source_file_path);
2113 if( !data_tool_src.
IsEmpty()) {
2122project.
m_Pch=
"FALSE";
2132 const string& proj_name,
2133 const string& applib_mfilepath,
2146 if(m == makefile.
end()) {
2159<<
" at "<< applib_mfilepath);
2162 constlist<string> asn_names = k->second;
2164list<CDataToolGeneratedSrc> datatool_sources;
2165 ITERATE(list<string>, p, asn_names) {
2166 const string&
asn= *p;
2172 if(
CDirEntry(asn_path_abs +
".asn").Exists() )
2173asn_path_abs +=
".asn";
2174 else if(
CDirEntry(asn_path_abs +
".dtd").Exists() )
2175asn_path_abs +=
".dtd";
2176 else if(
CDirEntry(asn_path_abs +
".xsd").Exists() )
2177asn_path_abs +=
".xsd";
2180 stringparent_dir_abs =
ParentDir(source_base_dir);
2186 if(
CDirEntry(asn_path_abs +
".asn").Exists() )
2187asn_path_abs +=
".asn";
2188 else if(
CDirEntry(asn_path_abs +
".dtd").Exists() )
2189asn_path_abs +=
".dtd";
2190 else if(
CDirEntry(asn_path_abs +
".xsd").Exists() )
2191asn_path_abs +=
".xsd";
2199 if(
CDirEntry(asn_path_abs +
".asn").Exists() )
2200asn_path_abs +=
".asn";
2201 else if(
CDirEntry(asn_path_abs +
".dtd").Exists() )
2202asn_path_abs +=
".dtd";
2203 else if(
CDirEntry(asn_path_abs +
".xsd").Exists() )
2204asn_path_abs +=
".xsd";
2207 "ASN spec file not found");
2214 if( !data_tool_src.
IsEmpty() )
2215datatool_sources.push_back(data_tool_src);
2224<<
" at "<< applib_mfilepath);
2227list<string> src_list = k->second;
2231 copy(k->second.begin(), k->second.end(), back_inserter(src_list));
2234list<string> sources;
2235 ITERATE(list<string>, p, src_list) {
2236 const string& src = *p;
2238sources.push_back(src);
2244proj_name, applib_mfilepath, makelib,
tree, maketype) :
2246proj_name, applib_mfilepath, makeapp,
tree, maketype);
2247 if( proj_id.
Id().empty() )
2251 if(pid ==
tree->m_Projects.
end()) {
2253<<
" at "<< applib_mfilepath);
2261 ITERATE(list<string>, p, src_list) {
2262 const string& src = *p;
2266 ITERATE( list<CDataToolGeneratedSrc>, dts, datatool_sources) {
2267 const string&
asn= dts->m_SourceCPP;
2272project.
m_Sources.push_back(src +
"__");
2273project.
m_Sources.push_back(src +
"___");
2276 if( !datatool_sources.empty() ) {
2288 const string& proj_name,
2289 const string& applib_mfilepath,
2295 if(m == makemsvc.
end()) {
2305proj_id = proj_name;
2308k = m->second.m_Contents.find(is_xcode ?
"XCODE_PROJ":
"MSVC_PROJ");
2309 if(k == m->second.m_Contents.end() ||
2310k->second.empty()) {
2313<<
" at "<< applib_mfilepath);
2316proj_id = k->second.front();
2321 if(z !=
tree->m_Projects.
end()) {
2323 stringfull_makefile_path = applib_mfilepath;
2325 "Native project \'"<< proj_id <<
"\' already defined at " 2326<<
tree->m_Projects[proj_key].m_SourcesBaseDir);
2339list<string> sources;
2343 stringvcproj_key(
"VCPROJ");
2345vcproj_key =
"VCXPROJ";
2347k = m->second.m_Contents.find(vcproj_key);
2348 if(k == m->second.m_Contents.end()) {
2351<<
" at "<< applib_mfilepath);
2354 ITERATE(list<string>, s, k->second) {
2360sources.push_back( d );
2366list<CProjKey> depends_ids;
2367k = m->second.m_Contents.find(
"LIB_DEP");
2368 if(k != m->second.m_Contents.end()) {
2369 constlist<string> deps = k->second;
2370 ITERATE(list<string>, p, deps) {
2374k = m->second.m_Contents.find(
"APP_DEP");
2375 if(k != m->second.m_Contents.end()) {
2376 constlist<string> deps = k->second;
2377 ITERATE(list<string>, p, deps) {
2381k = m->second.m_Contents.find(
"DLL_DEP");
2382 if(k != m->second.m_Contents.end()) {
2383 constlist<string> deps = k->second;
2384 ITERATE(list<string>, p, deps) {
2388k = m->second.m_Contents.find(
"MSVC_DEP");
2389 if(k != m->second.m_Contents.end()) {
2390 constlist<string> deps = k->second;
2391 ITERATE(list<string>, p, deps) {
2395k = m->second.m_Contents.find(
"USR_DEP");
2396 if(k != m->second.m_Contents.end()) {
2397 constlist<string> deps = k->second;
2400 copy(ids.begin(), ids.end(), back_inserter(depends_ids));
2405list<string> req_lst;
2406 if(m->second.CollectValues(
"REQUIRES", req_lst,
2410project_makefile.
Redefine(req_lst,reqs);
2413list<string> libs_3_party;
2414list<string> include_dirs;
2415list<string> defines;
2435m->second.CollectValues(
"PROJ_TAG", project.
m_ProjTags,
2438list<string> watchers;
2439 if(m->second.CollectValues(
"WATCHERS", watchers,
2444project.
m_MkName= applib_mfilepath;
2445 tree->m_Projects[proj_key] = project;
2461list<string> list_lib;
2465list<string> lib_list_in, lib_list_in0;
2466 for(
const string& lib : list_lib) {
2467 if(lib.at(0) ==
'#') {
2475 copy(
tmp.begin(),
tmp.end(), back_inserter(lib_list_in));
2477lib_list_in.push_back(def);
2480lib_list_in.push_back(lib);
2483 if(lib_list_in.empty()) {
2486lib_list_in0 = lib_list_in;
2491list<string> lib_list_out[2];
2493 for(pass=0; pass<4; ++pass) {
2496lib_list_out[0] = lib_list_out[1];
2497lib_list_out[1].
clear();
2499list<string>& list_in = pass == 0 ? lib_list_in : lib_list_out[0];
2500list<string>& list_out = pass == 0 ? lib_list_out[0] : lib_list_out[1];
2503 for(list<string>::const_iterator
l= list_in.begin(); ; ++
l) {
2506 if(
l== list_in.end()) {
2509 const string& lib = *
l;
2511list_out.push_back(lib);
2516list<string> resolved;
2519resolver.
Resolve(lib, &resolved);
2521for_each(resolved.begin(), resolved.end(), [&lib_contents, &lib](
const string& ce) {
2523CSymResolver::StripSuffix(e);
2524if (!e.empty() && e.at(0) !=
'@') {
2525lib_contents[lib].insert(e);
2531 for(
const string& lib_item : lib_contents[lib]) {
2534for_each(alldepends.begin(), alldepends.end(), [&lib_dependencies, &lib](
const string& ce){
2536CSymResolver::StripSuffix(e);
2537if (!e.empty() && e.at(0) !=
'@') {
2538lib_dependencies[lib].insert(e);
2541list<string>::iterator iout = list_out.begin();
2542 booldo_append =
true;
2545 for(; iout != list_out.end(); ++iout) {
2546 for(
const string& lib_dep : lib_dependencies[lib]) {
2547 if(lib_contents[*iout].find(lib_dep) != lib_contents[*iout].end()) {
2559list_out.push_back(lib);
2563list<string>::const_iterator
i= iout;
2565 booldo_replace =
false;
2569already_there.
clear();
2570 for(
const string& lib_item : lib_contents[*iout]) {
2571 if(lib_contents[lib].find(lib_item) != lib_contents[lib].end()) {
2572already_there.
insert(lib_item);
2575 if(already_there.
size() == lib_contents[*iout].
size() &&
2576already_there.
size() != lib_contents[lib].
size()) {
2584already_there.
clear();
2585 for(
i= iout;
i!= list_out.end(); ++
i) {
2586 for(
const string& lib_item : lib_contents[lib]) {
2587 if(lib_contents[*
i].find(lib_item) != lib_contents[*
i].end()) {
2588already_there.
insert(lib_item);
2592 if(already_there.
size() == lib_contents[lib].
size()) {
2599already_there.
size() != 0 &&
2600already_there.
size() >= (lib_contents[lib].
size() * 3)/4) {
2601 for(
const string& lib_item : lib_contents[lib]) {
2602 if(already_there.
find(lib_item) == already_there.
end()) {
2603list_in.push_back(lib_item);
2611 booldo_insert =
true;
2616 for(;
i!= list_out.end(); ++
i) {
2617 for(
const string& lib_dep : lib_dependencies[*
i]) {
2618 if(lib_contents[lib].find(lib_dep) != lib_contents[lib].end()) {
2621 if(lib_contents[*
i].find(lib_dep) != lib_contents[*
i].end()) {
2637 if(do_append && ++
i== list_out.end()) {
2638list_out.push_back(lib);
2641iout = list_out.erase(iout);
2643list_out.insert(iout, lib);
2651 for(
i=iout;
i!= list_out.end(); ++
i) {
2652 for(
const string& lib_dep : lib_dependencies[lib]) {
2653 if(lib_contents[*
i].find(lib_dep) != lib_contents[*
i].end()) {
2654 if(lib_contents[lib].find(lib_dep) != lib_contents[lib].end()) {
2668list_out.erase(iout);
2669 for(
const string& lib_item : already_there) {
2670list_out.remove(lib_item);
2675list_out.push_back(lib);
2681list_out.push_back(lib);
2684 if(list_in.size() == list_out.size() &&
2685equal(list_in.begin(), list_in.end(), list_out.begin())) {
2690list<string> warnings;
2691warnings.push_back(
"====== Library order warnings (toolkit libs) ======");
2692warnings.push_back(
"present library order: "+
NStr::Join(lib_list_in0,
" "));
2693 if(lib_list_out[0].
size() == lib_list_out[1].
size() &&
2694equal(lib_list_out[0].begin(), lib_list_out[0].end(), lib_list_out[1].begin())) {
2695warnings.push_back(
"recommended library order: "+
NStr::Join(lib_list_out[0],
" "));
2698 for(
const string& lib_item: lib_list_out[0]) {
2699all_libs.
insert( lib_contents[lib_item].begin(),lib_contents[lib_item].end());
2700all_deps.
insert( lib_dependencies[lib_item].begin(),lib_dependencies[lib_item].end());
2703 for(
const string& lib_item: all_deps) {
2704 if(all_libs.
find(lib_item) == all_libs.
end()) {
2705all_missing.
insert(lib_item);
2708 if(!all_missing.
empty()) {
2709warnings.push_back(
"missing libraries: "+
NStr::Join(all_missing,
" "));
2712warnings.push_back(
"Failed to identify recommended library order");
2714warnings.push_back(
"candidate1: "+
NStr::Join(lib_list_out[0],
" "));
2715warnings.push_back(
"candidate2: "+
NStr::Join(lib_list_out[1],
" "));
2727 const string& root_src_path,
2738list<string> metadata_files;
2744 ITERATE(list<string>, p, metadata_files) {
2746 if(!
GetApp().m_BuildRoot.empty()) {
2749 if(fileloc.empty() || !
CFile(fileloc).Exists()) {
2752 if(!
CDirEntry(fileloc).Exists() && !
GetApp().m_ExtSrcRoot.empty()) {
2755 GetApp().GetConfig().
Get(
"ProjectTree",
"src")),
2763 boolis_good =
true;
2765 if(sym.
GetValue(
"REQUIRES", reqs)) {
2768 for(
const string&
i: items) {
2769 if(!
GetApp().GetSite().IsProvided(
i)) {
2777 PTB_INFO(
"Resolve macros using rules from "<< fileloc);
2778resolver.
Append( sym,
true);;
2787subtree_makefiles.
m_In,
2788subtree_makefiles.
m_Lib,
2789subtree_makefiles.
m_Dll,
2790subtree_makefiles.
m_App,
2793 if(!
GetApp().IsScanningWholeTree()) {
2801 const string& root_src_path,
2809 if(
GetApp().IsScanningWholeTree()) {
2810*
tree= target_tree;
2813 t->second.m_External =
true;
2819 if(
GetApp().m_InteractiveCfg &&
2820!
GetApp().Gui_ConfirmProjects(target_tree))
2830list<CProjKey> external_depends;
2834 if( !external_depends.empty()) {
2835list<CProjKey> depends_to_resolve = external_depends;
2836 while( !depends_to_resolve.empty() ) {
2837 boolmodified =
false;
2838 ITERATE(list<CProjKey>, p, depends_to_resolve) {
2844 if(
n!=
GetApp().GetWholeTree().m_Projects.end()) {
2850 _TRACE(
"Project not found: "+ prj_id.
Id());
2857*
tree= target_tree;
2871*
tree= target_tree;
2887 GetApp().GetProjectTreeInfo().m_TreeNode);
2888 if( !is_root && !
CDirEntry(node_path).Exists() ) {
2897 "Makefile.in missing");
2905contents = dir.
GetEntries(
GetApp().GetProjectTreeInfo().m_CustomMetaData);
2909contents = dir.
GetEntries(
GetApp().GetProjectTreeInfo().m_CustomConfH);
2922 GetApp().GetProjectTreeInfo().m_Src, dir_name);
2926 "skipped missing subtree");
2932 boolprocess_projects = !is_root && filter->
CheckProject(dir_name,&weak);
2933 if(!process_projects && !weak && !is_root) {
2944vector<string> ordered_subprojects;
2946 boolhas_metal =
false;
2948 if(is_root && get_order) {
2952 if( process_projects || weak || !topbuilddir.empty()) {
2953 stringnode(topbuilddir.empty() ? node_path : topbuilddir);
2956 if(p != makefiles->
m_In.
end()) {
2961 stringsubproj[] = {
"SUB_PROJ",
"EXPENDABLE_SUB_PROJ",
"POTENTIAL_SUB_PROJ",
""};
2966 for(j=0; !subproj[j].empty(); ++j) {
2969 constlist<string>& values = k->second;
2970 for(list<string>::const_iterator
i=values.begin();
i!=values.end(); ++
i) {
2971 if(
i->at(0) ==
'#') {
2974subprojects[*
i] =
max(maketype, subtype[j]);
2975ordered_subprojects.push_back(*
i);
2979 if( process_projects ) {
2980 stringuserproj[] = {
"UNIX_PROJ",
"EXPENDABLE_UNIX_PROJ",
""};
2983userproj[0] = is_xcode ?
"XCODE_PROJ":
"MSVC_PROJ";
2987 for(j=0; !userproj[j].empty(); ++j) {
2990 constlist<string>& values = k->second;
2991 for(list<string>::const_iterator
i=values.begin();
i!=values.end(); ++
i) {
2992 if(
i->at(0) ==
'#') {
2996userprojects[
"Makefile."+ *
i] =
max(maketype, usertype[j]);
2997userprojects[
"Makefile."+ *
i+
".in"] =
max(maketype, usertype[j]);
3003 stringmkname(
"Makefile."+ *
i);
3005mkname +=
".msvcproj";
3007userprojects[mkname] =
max(maketype, usertype[j]);
3015 stringlibproj[] = {
"ASN_PROJ",
"DTD_PROJ",
"XSD_PROJ",
"WSDL_PROJ",
"JSD_PROJ",
"PROTOBUF_PROJ",
3016 "LIB_PROJ",
"EXPENDABLE_LIB_PROJ",
"POTENTIAL_LIB_PROJ",
""};
3021 for(j=0; !libproj[j].empty(); ++j) {
3024 constlist<string>& values = k->second;
3025 for(list<string>::const_iterator
i=values.begin();
i!=values.end(); ++
i) {
3026 if(
i->at(0) ==
'#') {
3029 stringmkname(
"Makefile."+ *
i+
".lib");
3030libprojects[mkname] =
max(maketype, libtype[j]);
3037 stringdllproj[] = {
"DLL_PROJ",
"EXPENDABLE_DLL_PROJ",
"POTENTIAL_DLL_PROJ",
""};
3040 for(j=0; !dllproj[j].empty(); ++j) {
3043 constlist<string>& values = k->second;
3044 for(list<string>::const_iterator
i=values.begin();
i!=values.end(); ++
i) {
3045 if(
i->at(0) ==
'#') {
3048 stringmkname(
"Makefile."+ *
i+
".dll");
3049dllprojects[mkname] =
max(maketype, dlltype[j]);
3056 stringmetallib[] = {
"METAL_PROJ",
""};
3058 for(j=0; !metallib[j].empty(); ++j) {
3061 constlist<string>& values = k->second;
3062 for(list<string>::const_iterator
i=values.begin();
i!=values.end(); ++
i) {
3063 if(
i->at(0) ==
'#') {
3066 stringmkname(
"Makefile."+ *
i+
".metal");
3067libprojects[mkname] =
max(maketype, metaltype[j]);
3075 stringappproj[] = {
"APP_PROJ",
"EXPENDABLE_APP_PROJ",
"POTENTIAL_APP_PROJ",
""};
3080 for(j=0; !appproj[j].empty(); ++j) {
3083 constlist<string>& values = k->second;
3084 for(list<string>::const_iterator
i=values.begin();
i!=values.end(); ++
i) {
3085 if(
i->at(0) ==
'#') {
3088 stringmkname(
"Makefile."+ *
i+
".app");
3089appprojects[mkname] =
max(maketype, apptype[j]);
3101 if( process_projects && !libprojects.
empty()) {
3106 const stringname = dir_entry->GetName();
3107 if(libprojects.
find(name) != libprojects.
end() &&
3113contents = dir.
GetEntries(
"Makefile.*.metal");
3116 const stringname = dir_entry->GetName();
3117 if(libprojects.
find(name) != libprojects.
end()) {
3124 if( process_projects && !dllprojects.
empty()) {
3129 const stringname = dir_entry->GetName();
3130 if(dllprojects.
find(name) != dllprojects.
end() &&
3137 if( process_projects && !appprojects.
empty() ) {
3142 const stringname = dir_entry->GetName();
3143 if(appprojects.
find(name) != appprojects.
end() &&
3150 if( process_projects && !userprojects.
empty() ) {
3156 const stringname = dir_entry->GetName();
3157 if(userprojects.
find(name) != userprojects.
end()
3164 if( process_projects) {
3171contents = dir.
GetEntries(
GetApp().GetProjectTreeInfo().m_CustomConfH);
3180vector<string> ordered_subprojects_dirs;
3183 ITERATE( vector<string>, p, ordered_subprojects) {
3186 if( dir_entry.
IsDir() ) {
3187 if(subprojects.
find(name) != subprojects.
end()) {
3188subprojects_dirs[dir_entry.
GetPath()] = subprojects[name];
3190subprojects_dirs[dir_entry.
GetPath()] =
3193 if(find(ordered_subprojects_dirs.begin(), ordered_subprojects_dirs.end(), name) ==
3194ordered_subprojects_dirs.end()) {
3195ordered_subprojects_dirs.push_back(name);
3198 "Duplicate entry: "<< name);
3208 if( !dir_entry->IsDir() ) {
3211 stringname = dir_entry->GetName();
3213 if( name[0] ==
'.'|| name ==
"CVS"||
3217 if(find(ordered_subprojects_dirs.begin(), ordered_subprojects_dirs.end(), name) !=
3218ordered_subprojects_dirs.end()) {
3222 if(subprojects.
find(name) != subprojects.
end()) {
3223subprojects_dirs[dir_entry->GetPath()] = subprojects[name];
3225subprojects_dirs[dir_entry->GetPath()] =
3228 if(find(ordered_subprojects_dirs.begin(), ordered_subprojects_dirs.end(), name) ==
3229ordered_subprojects_dirs.end()) {
3230ordered_subprojects_dirs.push_back(name);
3235 for(s = subprojects.
begin(); s != subprojects.
end(); ++s) {
3236 if(s->first.
find(
'/') != string::npos) {
3239 if(dir_entry.
IsDir()) {
3240subprojects_dirs[dir_entry.
GetPath()] = subprojects[s->first];
3259 ITERATE( vector<string>, ps, ordered_subprojects_dirs) {
3261 ProcessDir(subproject_dir,
false, filter, makefiles, subprojects_dirs[subproject_dir], mkin);
3303 strings =
"MakeDll : "+
file_name+
" ";
3310 PTB_INFO(s <<
"rejected (is empty)");
3352 _TRACE(
"*** Resolving macrodefinitions in App projects ***");
3358keys.
insert(
"STATIC_LIB");
3359keys.
insert(
"STATIC_LIBS");
3361keys.
insert(
"NCBI_C_LIBS");
3366 _TRACE(
"*** Resolving macrodefinitions in Lib projects ***");
3372keys.
insert(
"STATIC_LIB");
3373keys.
insert(
"STATIC_LIBS");
3376keys.
insert(
"DLL_LIB");
3378keys.
insert(
"DLL_DLIB");
3384 _TRACE(
"*** Resolving macrodefinitions in Msvc projects ***");
3386keys.
insert(
"DLL_DEP");
3402 const CProjKey& project_id = p->first;
3409 stringsrc_abs_path =
3411 stringsrc_rel_path =
3413(
GetApp().GetProjectTreeInfo().m_Src,
3415(*datatool_ids)[src_rel_path] = project_id;
3427 boolwhole_collected =
false;
3428 if(
GetApp().IsScanningWholeTree()) {
3429whole_collected =
true;
3434 booltree_extented =
false;
3439tree_extented =
false;
3450 const string& module = *
i;
3452datatool_ids.
find(module);
3453 if(j == datatool_ids.
end()) {
3454 if(!whole_collected) {
3455whole_collected =
true;
3458j = whole_datatool_ids.
find(module);
3459 if(j != whole_datatool_ids.
end()) {
3460 const CProjKey& depends_id = j->second;
3462datatool_ids[module] = depends_id;
3465 tree->m_Projects[depends_id] =
3467tree_extented =
true;
3475tree_extented = !added.
empty();
3477 tree->m_Projects[p->first] = p->second;
3480}
while( tree_extented );
3488 const CProjKey& project_id = p->first;
3495 if(z !=
tree->m_Projects.
end()) {
3496z->second.m_DatatoolSources.push_back(src);
3499 const string& module = *
i;
3501datatool_ids.
find(module);
3502 if(j != datatool_ids.
end()) {
3503 const CProjKey& depends_id = j->second;
3504 if(depends_id != project_id) {
3505project.
m_Depends.push_back(depends_id);
EBuildType GetType(void) const
static EMsvcPlatform GetMsvcPlatform(void)
static string GetTopBuilddir(void)
static EMsvcVersion GetMsvcVersion(void)
CMsvcProjectMakefile â.
bool Redefine(const string &value, list< string > &redef) const
void Append(list< string > &values, const string &def) const
virtual void GetAdditionalLIB(const SConfigInfo &config, list< string > *lib_ids) const
virtual void GetExcludedLIB(const SConfigInfo &config, list< string > *lib_ids) const
bool IsLibWithChoice(const string &lib_id) const
void CollectRequires(const list< string > &reqs) const
bool ResolveDefine(const string &define, string &resolved) const
bool Is3PartyLibWithChoice(const string &lib3party_id) const
void GetLibChoiceIncludes(const string &cpp_flags_define, list< string > *abs_includes) const
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
set< string > m_Frameworks
void UpdateDepGraph(CProjectTreeBuilder::TFiles &files)
void AddCustomMetaData(const string &file)
const CBuildType & GetBuildType(void)
map< string, list< string > > m_3PartyLibraryOrder
map< string, set< string > > m_GraphDepIncludes
map< string, size_t > m_GraphDepRank
set< string > m_3PartyLibs
map< string, list< string > > m_LibraryOrder
void SetFail(int exit_code=1)
void RegisterSuspiciousProject(const CProjKey &proj)
void ExcludeUnrequestedProjects(CProjectItemsTree &tree) const
void AddCustomConfH(const string &file)
void GetMetaDataFiles(list< string > *files) const
string ProcessLocationMacros(string data)
const CProjectItemsTree & GetWholeTree(void)
const CMsvc7RegSettings & GetRegSettings(void)
void ExcludeProjectsByTag(CProjectItemsTree &tree) const
map< string, set< string > > m_GraphDepFlags
bool IsScanningWholeTree(void) const
map< string, set< string > > m_GraphDepPrecedes
const CMsvcSite & GetSite(void)
list< string > m_IncludeDirs
Resolved contents of CPPFLAG ( -I<m_IncludeDir> -I/..) Absolute pathes.
list< string > m_Sources
List of source files without extension ( *.cpp or *.c ) - with relative pathes from m_SourcesBaseDir.
CSimpleMakeFileContents m_DataSource
list< CProjKey > m_Depends
What projects this project is depend upon (IDs).
list< CDataToolGeneratedSrc > m_DatatoolSources
Source files *.asn , *.dtd to be processed by datatool app.
TProjType m_ProjType
Type of the project.
EMakeFileType m_MakeType
Type of the project.
string m_ID
ID of atomic project.
list< string > m_HostedLibs
string m_GUID
project GUID
string m_Pch
Precompiled header.
list< string > m_NcbiCLibs
Libraries from NCBI C Toolkit to link with.
list< string > m_ProjTags
string m_Name
Name of atomic project.
string m_SourcesBaseDir
Base directory of source files (....c++/src/a/ )
list< string > m_CheckInfo
const string & Id(void) const
TProjType Type(void) const
Resolver for SRC keys in Makefiles:
void ResolveTo(list< string > *sources_dst)
static void CreateFrom(const string &root_src, const TFiles &makein, const TFiles &makelib, const TFiles &makedll, const TFiles &makeapp, const TFiles &makemsvc, CProjectItemsTree *tree)
void GetExternalDepends(list< CProjKey > *externalDepends) const
Get depends that are not inside this project tree.
static bool VerifyBuildOrder(const CProjItem &item, list< string > dependencies, const CProjectItemsTree &tree)
static void ProcessDir(const string &dir_name, bool is_root, const IProjectFilter *filter, SMakeFiles *makefiles, EMakeFileType maketype, const CSimpleMakeFileContents *parent)
static void ProcessMakeLibFile(const string &file_name, SMakeFiles *makefiles, EMakeFileType type, const CSimpleMakeFileContents *parent)
static void BuildOneProjectTree(const IProjectFilter *filter, const string &root_src_path, CProjectItemsTree *tree)
Build one project tree and do not resolve (include) depends.
static void ProcessUserProjFile(const string &file_name, SMakeFiles *makefiles, EMakeFileType type, const CSimpleMakeFileContents *parent)
static void ResolveDefs(CSymResolver &resolver, SMakeFiles &makefiles)
static void AddDatatoolSourcesDepends(CProjectItemsTree *tree)
static void ProcessMakeAppFile(const string &file_name, SMakeFiles *makefiles, EMakeFileType type, const CSimpleMakeFileContents *parent)
static void ProcessMakeInFile(const string &file_name, SMakeFiles *makefiles, EMakeFileType type, const CSimpleMakeFileContents *parent)
static void BuildProjectTree(const IProjectFilter *filter, const string &root_src_path, CProjectItemsTree *tree)
Build project tree and include all projects this tree depends upon.
static void ProcessMakeDllFile(const string &file_name, SMakeFiles *makefiles, EMakeFileType type, const CSimpleMakeFileContents *parent)
CSimpleMakeFileContents â.
EMakeFileType GetMakeType(void) const
bool CollectValues(const string &key, list< string > &values, EHowToCollect how) const
bool GetValue(const string &key, string &value) const
void SetParent(const CSimpleMakeFileContents *parent)
void Resolve(const string &define, list< string > *resolved_def)
CSymResolver & Append(const CSymResolver &src, bool warn_redef=false)
static string StripDefine(const string &define)
static bool HasDefine(const string ¶m)
static bool StripSuffix(string &libname, string *suffix=nullptr)
static bool IsDefine(const string ¶m)
bool GetValue(const string &key, string &value) const
Utilits for Project Tree Builder:
virtual bool ExcludePotential(void) const =0
virtual bool CheckProject(const string &project_base_dir, bool *weak=0) const =0
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
pre_order_iterator begin() const
pre_order_iterator end() const
string MakeFileTypeAsString(EMakeFileType type)
static char test_name[128]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Error(CExceptionArgs_Base &args)
void Warning(CExceptionArgs_Base &args)
static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)
Normalize a path.
TEntries GetEntries(const string &mask=kEmptyStr, TGetEntriesFlags flags=0) const
Get directory entries based on the specified "mask".
static bool IsAbsolutePath(const string &path)
Check if a "path" is absolute for the current OS.
int TGetEntriesFlags
Binary OR of "EGetEntriesFlags".
static string DeleteTrailingPathSeparator(const string &path)
Delete trailing path separator, if any.
static string AddTrailingPathSeparator(const string &path)
Add trailing path separator, if needed.
static string CreateRelativePath(const string &path_from, const string &path_to)
Create a relative path between two points in the file system specified by their absolute paths.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
static string ConvertToOSPath(const string &path)
Convert "path" on any OS to the current OS-dependent path.
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
string GetName(void) const
Get the base entry name with extension (if any).
const string & GetPath(void) const
Get entry path.
string GetExt(void) const
Get extension name.
@ fIgnoreRecursive
Suppress "self recursive" elements (the directories "." and "..").
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static int CompareCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive compare of a substring with another string.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
string CreateMsvcProjectMakefileName(const string &project_name, CProjItem::TProjType type)
Create project makefile name.
#define LIST_SEPARATOR
Separator for list values in registry.
CProjKey CreateProjKey(const string &project_name)
string IdentifySlnGUID(const string &source_dir, const CProjKey &proj)
void EraseIf(C &cont, const P &pred)
Erase if predicate is true.
const TYPE & Get(const CNamedParameterList *param)
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
CProjBulderApp & GetApp(void)
access to App singleton
static size_t s_BuildOrder
void s_CollectDatatoolIds(const CProjectItemsTree &tree, map< string, CProjKey > *datatool_ids)
CProjItem CreateUtilityProjectItem(const string &prj_dir, const string &name)
static void s_CollectAllLeaves(const map< string, set< string > > &source_dep, const map< string, set< string > > &source_flags, const string &branch, set< string > &all_dep, set< string > &all_flags)
const char * s_check_separator
void s_WriteBuildOrder(const string &dir_name, const string &mkname)
static map< string, size_t > s_buildOrder_byname
void s_AnalyzeLibraryOrder(CSymResolver &resolver, const CProjectItemsTree &tree)
string ParentDir(const string &dir_abs)
#define PTB_INFO_EX(file, err_code, msg)
#define PTB_WARNING(file, msg)
#define PTB_ERROR_EX(file, err_code, msg)
@ ePTB_ConfigurationError
#define PTB_WARNING_EX(file, err_code, msg)
#define PTB_TRACE_EX(file, err_code, msg)
string FilterDefine(const string &define)
static bool check_name(const char *name)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
bool operator()(const string &lib_id) const
set< string > m_ExcludedLib
PLibExclude(const string &prj_name, const list< string > &excluded_lib_ids)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makeapp, CProjectItemsTree *tree, EMakeFileType maketype)
static void CreateNcbiCToolkitLibs(const CSimpleMakeFileContents &makefile, list< string > *libs_list)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makeapp, const TFiles &makelib, CProjectItemsTree *tree, const SMakeProjectT::SMakeInInfo &makeinfo)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makeapp, const TFiles &makelib, CProjectItemsTree *tree, const SMakeProjectT::SMakeInInfo &makeinfo)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makeapp, const TFiles &makelib, CProjectItemsTree *tree, const SMakeProjectT::SMakeInInfo &makeinfo)
static TAsnType GetAsnProjectType(const string &applib_mfilepath, const TFiles &makeapp, const TFiles &makelib)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makeapp, CProjectItemsTree *tree, EMakeFileType maketype)
static CProjKey DoCreateDataSpec(const string &source_base_dir, const string &proj_name, const string &proj_id, CProjectItemsTree *tree, EMakeFileType maketype)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makeapp, CProjectItemsTree *tree, EMakeFileType maketype)
static bool IsMakeAppFile(const string &name)
static void DoResolveDefs(CSymResolver &resolver, CProjectItemsTree::TFiles &files, const set< string > &keys)
static void VerifyLibDepends(list< CProjKey > &depends_ids, const string &mkname, list< string > &liborder, const set< string > *libs_3party=nullptr, list< string > *expected_3party=nullptr)
static bool IsMakeDllFile(const string &name)
static bool IsConfigurableDefine(const string &define)
static void ConvertLibDepends(const list< string > &depends_libs, list< CProjKey > *depends_ids, const string *mkname=NULL, list< string > *expected_3party=NULL)
static string CreateMakeAppLibFileName(const string &base_dir, const string &projname, SMakeInInfo::TMakeinType type=SMakeInInfo::eUnknown)
static void Create3PartyLibs(const list< string > &libs_flags, const list< string > &expected_flags, list< string > *libs_list, const string *mkname=NULL)
list< SMakeInInfo > TMakeInInfoList
static void CreateIncludeDirs(const list< string > &cpp_flags, const string &source_base_dir, list< string > *include_dirs)
static void CreateDefines(const list< string > &cpp_flags, list< string > *defines)
static void AnalyzeMakeIn(const CSimpleMakeFileContents &makein_contents, TMakeInInfoList *info)
static string ExtractConfigurableDefine(const string &define)
static bool HasConfigurableDefine(const string &define)
static void ConvertLibDependsMacro(const list< string > &depends, list< string > &depends_libs)
static string GetOneIncludeDir(const string &flag, const string &token)
static string StripConfigurableDefine(const string &define)
static bool IsMakeInFile(const string &name)
static bool IsMakeLibFile(const string &name)
static CProjItem::TProjType GetProjType(const string &base_dir, const string &projname, SMakeInInfo::TMakeinType type=SMakeInInfo::eUnknown)
static void CreateFullPathes(const string &dir, const list< string > files, list< string > *full_pathes)
static CProjKey DoCreate(const string &source_base_dir, const string &proj_name, const string &applib_mfilepath, const TFiles &makemsvc, CProjectItemsTree *tree, EMakeFileType maketype)
static wxAcceleratorEntry entries[3]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4