NCBI C++ ToolKit
msvc_project_context.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: msvc_project_context.cpp 99237 2023-03-01 16:35:07Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Viatcheslav Gorelenkov
27  *
28  */
29 
30 #include <ncbi_pch.hpp>
31 #include "stl_msvc_usage.hpp"
32 
33 #include "msvc_project_context.hpp"
34 #include "msvc_tools_implement.hpp"
35 #include "proj_builder_app.hpp"
36 #include "msvc_site.hpp"
37 #include "msvc_prj_defines.hpp"
38 #include "ptb_err_codes.hpp"
39 #include "proj_tree_builder.hpp"
40 
41 #include <algorithm>
42 #include <set>
43 
44 
46 
49 
50 //-----------------------------------------------------------------------------
52  : m_Project(project)
53 {
54  m_MakeType = project.m_MakeType;
55  //MSVC project name created from project type and project ID
57  project.m_ID));
58  m_ProjectId = project.m_ID;
59  m_ProjType = project.m_ProjType;
60 
62  m_Requires = project.m_Requires;
63 
64  // Get msvc project makefile
68  (project.m_SourcesBaseDir,
70 
71  // Done if this is ready MSVC project
72  if ( project.m_ProjType == CProjKey::eMsvc)
73  return;
74 
75  // Collect all dirs of source files into m_SourcesDirsAbs:
76  set<string> sources_dirs;
77  sources_dirs.insert(m_SourcesBaseDir);
78  ITERATE(list<string>, p, project.m_Sources) {
79 
80  const string& src_rel = *p;
81  string src_path = CDirEntry::ConcatPath(m_SourcesBaseDir, src_rel);
82  src_path = CDirEntry::NormalizePath(src_path);
83 
84  string dir;
85  CDirEntry::SplitPath(src_path, &dir);
86  sources_dirs.insert(dir);
87  }
88  copy(sources_dirs.begin(),
89  sources_dirs.end(),
90  back_inserter(m_SourcesDirsAbs));
91 
92 
93  // Creating project dir:
95  m_ProjectDir =
97  GetApp().GetRegSettings().m_CompilersSubdir);
98  m_ProjectDir =
100  GetApp().GetBuildType().GetTypeStr());
101  m_ProjectDir =
103  GetApp().GetRegSettings().m_ProjectsSubdir);
104  m_ProjectDir =
107  (GetApp().GetProjectTreeInfo().m_Src,
110 
111  string lib_dir = GetApp().GetBuildRoot();
112  if (lib_dir.empty()) {
113  lib_dir = GetApp().GetProjectTreeInfo().m_Compilers;
114  lib_dir = CDirEntry::ConcatPath(lib_dir,
115  GetApp().GetRegSettings().m_CompilersSubdir);
116  }
117  string type_dir = CDirEntry::ConcatPath(lib_dir,
118  GetApp().GetBuildType().GetTypeStr());
119 // it is either root/buildtype/[lib|bin]/$ConfigurationName
120 // or just root/$ConfigurationName
121  if (CDirEntry(type_dir).Exists()) {
122  m_StaticLibRoot = CDirEntry::ConcatPath(type_dir, "lib");
123  m_DynamicLibRoot = CDirEntry::ConcatPath(type_dir, "bin");
124  } else {
125  m_StaticLibRoot = m_DynamicLibRoot = lib_dir;
126  }
127 // find sources
128  string t, try_dir, inc_dir;
129  for ( t = try_dir = m_StaticLibRoot; ; try_dir = t) {
130  inc_dir = CDirEntry::ConcatPath(try_dir,
131  GetApp().GetConfig().Get("ProjectTree", "include"));
132  if (CDirEntry(inc_dir).Exists()) {
133  m_SrcRoot = CDirEntry(inc_dir).GetDir();
134  break;
135  }
136  t = CDirEntry(try_dir).GetDir();
137  if (t == try_dir) {
138  break;
139  }
140  }
141 
142  // Generate include dirs:
143  // Include dirs for appropriate src dirs
144  set<string> include_dirs;
145  ITERATE(list<string>, p, project.m_Sources) {
146  //create full path for src file
147  const string& src_rel = *p;
148  string src_abs = CDirEntry::ConcatPath(m_SourcesBaseDir, src_rel);
149  src_abs = CDirEntry::NormalizePath(src_abs);
150  //part of path (from <src> dir)
151  string rel_path =
152  CDirEntry::CreateRelativePath(GetApp().GetProjectTreeInfo().m_Src,
153  src_abs);
154  //add this part to <include> dir
155  string incl_path = CDirEntry::NormalizePath(
156  CDirEntry::ConcatPath(GetApp().GetProjectTreeInfo().m_Include,
157  rel_path));
158  string incl_dir;
159  CDirEntry::SplitPath(incl_path, &incl_dir);
160  include_dirs.insert(incl_dir);
161 
162  //impl include sub-dir
163  string impl_dir =
164  CDirEntry::ConcatPath(incl_dir,
165  GetApp().GetProjectTreeInfo().m_Impl);
166  impl_dir = CDirEntry::AddTrailingPathSeparator(impl_dir);
167  include_dirs.insert(impl_dir);
168  }
169  m_IncludeDirsAbs = project.m_Includes;
170  m_InlineDirsAbs = project.m_Inlines;
171 
172  SConfigInfo cfg_info; // default is enough
173  list<string> headers_in_include;
174  list<string> inlines_in_include;
176  list<string>::const_iterator h, hs;
177  GetMsvcProjectMakefile().GetHeadersInInclude( cfg_info, &headers_in_include);
178  GetMsvcProjectMakefile().GetInlinesInInclude( cfg_info, &inlines_in_include);
179  for (i = include_dirs.begin(); i != include_dirs.end(); ++i) {
180  for (h = headers_in_include.begin(); h != headers_in_include.end(); ++h) {
181  m_IncludeDirsAbs.push_back(CDirEntry::ConcatPath(*i, *h));
182  }
183  for (h = inlines_in_include.begin(); h != inlines_in_include.end(); ++h) {
184  m_InlineDirsAbs.push_back(CDirEntry::ConcatPath(*i, *h));
185  }
186  }
187  list<string> headers_in_src;
188  list<string> inlines_in_src;
189  GetMsvcProjectMakefile().GetHeadersInSrc( cfg_info, &headers_in_src);
190  GetMsvcProjectMakefile().GetInlinesInSrc( cfg_info, &inlines_in_src);
191  for (hs = m_SourcesDirsAbs.begin(); hs != m_SourcesDirsAbs.end(); ++hs) {
192  for (h = headers_in_src.begin(); h != headers_in_src.end(); ++h) {
193  m_IncludeDirsAbs.push_back(CDirEntry::ConcatPath(*hs, *h));
194  }
195  for (h = inlines_in_src.begin(); h != inlines_in_src.end(); ++h) {
196  m_InlineDirsAbs.push_back(CDirEntry::ConcatPath(*hs, *h));
197  }
198  }
199 
200  m_IncludeDirsAbs.sort();
201  m_IncludeDirsAbs.unique();
202  m_InlineDirsAbs.sort();
203  m_InlineDirsAbs.unique();
204 
205  // Get custom build files and adjust pathes
207 
208  // Collect include dirs, specified in project Makefiles
210 
211  // LIBS from Makefiles
212  if (!project.m_Libs3Party.empty()) {
213  // m_ProjectLibs = project.m_Libs3Party;
214  list<string> installed_3party;
215  GetApp().GetSite().GetThirdPartyLibsToInstall(&installed_3party);
216 
217  ITERATE(list<string>, p, project.m_Libs3Party) {
218  const string& lib_id = *p;
219  if ( GetApp().GetSite().IsLibWithChoice(lib_id) ) {
220  if ( GetApp().GetSite().GetChoiceForLib(lib_id) == CMsvcSite::eLib )
221  m_ProjectLibs.push_back(lib_id);
222  } else {
223  m_ProjectLibs.push_back(lib_id);
224  }
225 
226  ITERATE(list<string>, i, installed_3party) {
227  const string& component = *i;
228  bool lib_ok = true;
229  ITERATE(list<SConfigInfo>, j, GetApp().GetRegSettings().m_ConfigInfo) {
230  const SConfigInfo& config = *j;
231  SLibInfo lib_info;
232  GetApp().GetSite().GetLibInfo(component, config, &lib_info);
233  if (find( lib_info.m_Macro.begin(), lib_info.m_Macro.end(), lib_id) ==
234  lib_info.m_Macro.end()) {
235  lib_ok = false;
236  break;
237  }
238  }
239  if (lib_ok) {
240  m_Requires.push_back(component);
241  }
242  }
243  }
244  }
245  m_Requires.sort();
246  m_Requires.unique();
247 
248  // Proprocessor definitions from makefiles:
249  m_Defines = project.m_Defines;
250  if (GetApp().GetBuildType().GetType() == CBuildType::eDll) {
251  m_Defines.push_back(GetApp().GetConfig().Get(CMsvc7RegSettings::GetMsvcSection(), "DllBuildDefine"));
252  }
253  // Pre-Builds for LIB projects:
254  {
256  CProjKey proj_key = *p;
257  {
258  const CProjectItemsTree* curr_tree = GetApp().GetCurrentBuildTree();
259  if (GetApp().GetIncompleteBuildTree()) {
260  // do not attempt to prebuild what is missing
261  if (GetApp().GetIncompleteBuildTree()->m_Projects.find(proj_key) ==
262  GetApp().GetIncompleteBuildTree()->m_Projects.end()) {
263  continue;
264  }
265  } else if (curr_tree) {
266  if (curr_tree->m_Projects.find(proj_key) ==
267  curr_tree->m_Projects.end()) {
268 
269  bool depfound = false;
270  string dll(GetDllHost(*curr_tree, proj_key.Id()));
271  if (!dll.empty()) {
272  CProjKey id_alt(CProjKey::eDll,dll);
273  if (curr_tree->m_Projects.find(id_alt) !=
274  curr_tree->m_Projects.end()) {
275  proj_key = id_alt;
276  depfound = true;
277  }
278  }
279  if (!depfound) {
282  ePTB_ProjectNotFound, "depends on missing project: " << proj_key.Id());
283  }
284  }
285  }
286  if (!SMakeProjectT::IsConfigurableDefine(proj_key.Id())) {
287  m_PreBuilds.push_back(proj_key);
288  }
289  }
290  }
291  }
292 
293  // Libraries from NCBI C Toolkit
294  m_NcbiCLibs = project.m_NcbiCLibs;
295 }
296 
297 
299  (const SConfigInfo& cfg_info) const
300 {
301  list<string> add_include_dirs_list;
302  list<string> dirs;
303  string dir;
304 
305  if (!GetApp().m_IncDir.empty()) {
306  string config_inc = CDirEntry::AddTrailingPathSeparator(GetApp().m_IncDir);
307  config_inc = CDirEntry::CreateRelativePath(m_ProjectDir, config_inc);
308  add_include_dirs_list.push_back( config_inc );
309  }
310 
311  // project dir
312  string tree_inc_abs(GetApp().GetProjectTreeInfo().m_Include);
313  string tree_inc = CDirEntry::CreateRelativePath(m_ProjectDir, tree_inc_abs);
314  tree_inc = CDirEntry::AddTrailingPathSeparator(tree_inc);
315  add_include_dirs_list.push_back( tree_inc );
316 
317  // internal, if present
318  string internal_inc = CDirEntry::ConcatPath(tree_inc,"internal");
320  add_include_dirs_list.push_back( CDirEntry::AddTrailingPathSeparator(internal_inc) );
321  }
322 
323  //take into account project include dirs
324  ITERATE(list<string>, p, m_ProjectIncludeDirs) {
325  const string& dir_abs = *p;
326  if (dir_abs == tree_inc_abs) {
327  continue;
328  }
329  dirs.clear();
330  if (CSymResolver::IsDefine(dir_abs)) {
331  GetApp().GetSite().GetLibInclude( dir_abs, cfg_info, &dirs);
332  } else {
333  dirs.push_back(dir_abs);
334  }
335  for (list<string>::const_iterator i = dirs.begin(); i != dirs.end(); ++i) {
336  dir = *i;
337  /*if (CDirEntry(dir).IsDir())*/ {
338  add_include_dirs_list.push_back(
339  !GetApp().UseAbsolutePath(dir) && SameRootDirs(m_ProjectDir,dir) ?
341  dir);
342  }
343  }
344  }
345 
346  //MSVC Makefile additional include dirs
347  list<string> makefile_add_incl_dirs;
349  &makefile_add_incl_dirs);
350 
351  ITERATE(list<string>, p, makefile_add_incl_dirs) {
352  const string& dir = *p;
353  string dir_abs =
356  dir_abs = CDirEntry::NormalizePath(dir_abs);
357  dir_abs =
359  (m_ProjectDir, dir_abs);
360  add_include_dirs_list.push_back(dir_abs);
361  }
362 
363  // Additional include dirs for 3-party libs
364  list<string> libs_list;
365  CreateLibsList(&libs_list);
366  ITERATE(list<string>, p, libs_list) {
367  GetApp().GetSite().GetLibInclude(*p, cfg_info, &dirs);
368  for (list<string>::const_iterator i = dirs.begin(); i != dirs.end(); ++i) {
369  dir = *i;
370  if ( !dir.empty() ) {
371  if (!GetApp().UseAbsolutePath(dir) && SameRootDirs(m_ProjectDir,dir)) {
373  }
374  if (find(add_include_dirs_list.begin(),
375  add_include_dirs_list.end(), dir) !=add_include_dirs_list.end()) {
376  continue;
377  }
378  add_include_dirs_list.push_back(dir);
379  }
380  }
381  }
382 
383  string ext_inc;
384  const CProjectItemsTree* all_projects = GetApp().GetIncompleteBuildTree();
385  if (all_projects) {
386  string inc_dir = CDirEntry::ConcatPath(m_SrcRoot,
387  GetApp().GetConfig().Get("ProjectTree", "include"));
388  if (CDirEntry(inc_dir).Exists()) {
389  try {
390  ext_inc = CDirEntry::CreateRelativePath(m_ProjectDir, inc_dir);
391  } catch (CFileException&) {
392  ext_inc = inc_dir;
393  }
394  ext_inc = CDirEntry::AddTrailingPathSeparator(ext_inc);
395  if (NStr::CompareNocase(tree_inc, ext_inc) != 0) {
396  add_include_dirs_list.push_back( ext_inc );
397  }
398  }
399  }
400  //Leave only unique dirs and join them to string
401 // add_include_dirs_list.sort();
402 // add_include_dirs_list.unique();
403  return NStr::Join(add_include_dirs_list, ";");
404 }
405 
406 
408  (const SConfigInfo& cfg_info) const
409 {
410  list<string> additional_libs;
411  const CMsvcSite& site = GetApp().GetSite();
412 
413  // Take into account requires, default and makefiles libs
414  list<string> libs_list;
415  CreateLibsList(&libs_list);
416  ITERATE(list<string>, p, libs_list) {
417  const string& reqs = *p;
418  if (site.Is3PartyLibWithChoice(reqs)) {
419  if (site.GetChoiceFor3PartyLib(reqs, cfg_info) == CMsvcSite::eLib) {
420  continue;
421  }
422  }
423  SLibInfo lib_info;
424  site.GetLibInfo(reqs, cfg_info, &lib_info);
425  if ( site.IsLibOk(lib_info) &&
426  GetApp().GetSite().IsLibEnabledInConfig(reqs, cfg_info)) {
427  if ( !lib_info.m_Libs.empty() ) {
428  copy(lib_info.m_Libs.begin(), lib_info.m_Libs.end(),
429  back_inserter(additional_libs));
430  }
431  if ( !lib_info.m_StdLibs.empty() ) {
432  copy(lib_info.m_StdLibs.begin(), lib_info.m_StdLibs.end(),
433  back_inserter(additional_libs));
434  }
435  } else {
436  if (!lib_info.IsEmpty() && !lib_info.m_Libs.empty()) {
438  reqs << "|" << cfg_info.GetConfigFullName()
439  << " unavailable: missing additional libraries: "
440  << NStr::Join(lib_info.m_Libs,";"));
441 
442  }
443  }
444  }
445 
446  // NCBI C Toolkit libs
447  ITERATE(list<string>, p, m_NcbiCLibs) {
448  string ncbi_lib = *p + ".lib";
449  additional_libs.push_back(ncbi_lib);
450  }
451 
452  const CProjectItemsTree* all_projects = GetApp().GetIncompleteBuildTree();
453  if (all_projects) {
454  string static_lib_dir = CDirEntry::ConcatPath(m_StaticLibRoot, cfg_info.GetConfigFullName());
455  string dynamic_lib_dir = CDirEntry::ConcatPath(m_DynamicLibRoot, cfg_info.GetConfigFullName());
456  ITERATE(list<CProjKey>, n, m_Project.m_Depends) {
457  const CProjKey& depend_id = *n;
458  if (SMakeProjectT::IsConfigurableDefine(depend_id.Id())) {
459  continue;
460  }
461  if (depend_id.Type() == CProjKey::eLib || depend_id.Type() == CProjKey::eDll) {
463  all_projects->m_Projects.find(depend_id);
464  if (i == all_projects->m_Projects.end()) {
465  string lib_path = CDirEntry::ConcatPath(
466  depend_id.Type() == CProjKey::eLib ? static_lib_dir : dynamic_lib_dir,
467  depend_id.Id());
468  lib_path += ".lib";
469  CDirEntry lib(lib_path);
470  if (!lib.Exists()) {
471  if (!GetApp().m_BuildRoot.empty()) {
473  "Library not found: " << lib_path);
474  } else {
476  "Library not found: " << lib_path);
477  }
478  }
479  additional_libs.push_back(lib.GetName());
480  }
481  }
482  }
483  }
484 
486  additional_libs.sort();
487  additional_libs.unique();
488  }
489  return NStr::Join(additional_libs, " ");
490 }
491 
492 #if 0
493 string CMsvcPrjProjectContext::AdditionalLibrarianOptions
494  (const SConfigInfo& cfg_info) const
495 {
496  return AdditionalLinkerOptions(cfg_info);
497 }
498 #endif
499 
501  (const SConfigInfo& cfg_info) const
502 {
503  list<string> dir_list;
504  const CMsvcSite& site = GetApp().GetSite();
505 // library folder
506  const CProjectItemsTree* all_projects = GetApp().GetIncompleteBuildTree();
507  if (all_projects) {
508  string lib_dir;
509  try {
511  } catch (CFileException&) {
512  lib_dir = m_StaticLibRoot;
513  }
515  dir_list.push_back(CDirEntry::AddTrailingPathSeparator(lib_dir));
516  if (GetApp().GetBuildType().GetType() == CBuildType::eDll) {
517  try {
519  } catch (CFileException&) {
520  lib_dir = m_DynamicLibRoot;
521  }
523  dir_list.push_back(CDirEntry::AddTrailingPathSeparator(lib_dir));
524  }
525  }
526 
527  // Take into account requires, default and makefiles libs
528  list<string> libs_list;
529  CreateLibsList(&libs_list);
530  ITERATE(list<string>, p, libs_list) {
531  const string& reqs = *p;
532  if (site.Is3PartyLibWithChoice(reqs)) {
533  if (site.GetChoiceFor3PartyLib(reqs, cfg_info) == CMsvcSite::eLib) {
534  continue;
535  }
536  }
537  SLibInfo lib_info;
538  site.GetLibInfo(reqs, cfg_info, &lib_info);
539  if ( site.IsLibOk(lib_info) &&
540  site.IsLibEnabledInConfig(reqs, cfg_info) ) {
541  if ( !lib_info.m_LibPath.empty() ) {
542  dir_list.push_back(CDirEntry::AddTrailingPathSeparator(lib_info.m_LibPath));
543  }
544  } else {
545  if (!lib_info.IsEmpty()) {
547  reqs << "|" << cfg_info.GetConfigFullName()
548  << " unavailable: library folder ignored: "
549  << lib_info.m_LibPath);
550  }
551  }
552  }
553  dir_list.sort();
554  dir_list.unique();
555  return NStr::Join(dir_list, ";");
556 }
557 
558 
559 void CMsvcPrjProjectContext::CreateLibsList(list<string>* libs_list) const
560 {
561  libs_list->clear();
562  // We'll build libs list.
563  *libs_list = m_Requires;
564  //and LIBS from Makefiles:
565  ITERATE(list<string>, p, m_ProjectLibs) {
566  const string& lib = *p;
567  list<string> components;
568  GetApp().GetSite().GetComponents(lib, &components);
569  copy(components.begin(),
570  components.end(), back_inserter(*libs_list));
571 
572  }
573  libs_list->sort();
574  libs_list->unique();
575  //take into account default libs from site:
576  libs_list->push_back(MSVC_DEFAULT_LIBS_TAG);
577 }
578 
581 {
582  if ( m_MsvcCombinedProjectMakefile.get() )
584 
585  string rules_dir = GetApp().GetProjectTreeInfo().m_Compilers;
586  rules_dir =
587  CDirEntry::ConcatPath(rules_dir,
588  GetApp().GetRegSettings().m_CompilersSubdir);
589 
590 
591  // temporary fix with const_cast
592  (const_cast<unique_ptr<CMsvcCombinedProjectMakefile>&>
594  (m_ProjType,
595  m_MsvcProjectMakefile.get(),
596  rules_dir,
597  m_Requires));
598 
600 }
601 
602 
603 bool CMsvcPrjProjectContext::IsRequiresOk(const CProjItem& prj, string* unmet)
604 {
605  ITERATE(list<string>, p, prj.m_Requires) {
606  const string& reqs = *p;
607  if ( !GetApp().GetSite().IsProvided(reqs) &&
608  !GetApp().GetSite().IsProvided(reqs, false) ) {
609  if (unmet) {
610  *unmet = reqs;
611  }
612  return false;
613  }
614  }
615  return true;
616 }
617 
618 
620  string* unmet, string* unmet_req) const
621 {
622  list<string> libs_3party;
623  ITERATE(list<string>, p, m_ProjectLibs) {
624  const string& lib = *p;
625  list<string> components;
626  GetApp().GetSite().GetComponents(lib, &components);
627  copy(components.begin(),
628  components.end(), back_inserter(libs_3party));
629  }
630  list<string> libs_required;
631  ITERATE(list<string>, p, m_Requires) {
632  const string& lib = *p;
633  list<string> components;
634  GetApp().GetSite().GetComponents(lib, &components);
635  if (components.empty()) {
636  libs_required.push_back(lib);
637  } else {
638  copy(components.begin(),
639  components.end(), back_inserter(libs_required));
640  }
641  }
642 
643  // Add requires to test : If there is such library and configuration for
644  // this library is disabled then we'll disable this config
645  copy(m_Requires.begin(), m_Requires.end(), back_inserter(libs_3party));
646  libs_3party.sort();
647  libs_3party.unique();
648 
649  // Test third-party libs and requires:
650  const CMsvcSite& site = GetApp().GetSite();
651  bool result = true;
652  ITERATE(list<string>, p, libs_3party) {
653  const string& reqs = *p;
654  SLibInfo lib_info;
655  site.GetLibInfo(reqs, config, &lib_info);
656 
657  if ( lib_info.IsEmpty() ) {
658  bool st =
659  (config.m_rtType == SConfigInfo::rtSingleThreaded ||
661  if ((reqs == "MT" && st) || (reqs == "-MT" && !st)) {
662  if (unmet) {
663  if (!unmet->empty()) {
664  *unmet += ", ";
665  }
666  *unmet += reqs;
667  }
668  result = false;
669  }
670  continue;
671  }
672 
673  bool disabled = false;
674  if ( !site.IsLibEnabledInConfig(reqs, config) ) {
675  if (unmet) {
676  if (!unmet->empty()) {
677  *unmet += ", ";
678  }
679  *unmet += reqs;
680  }
681  if (find( libs_required.begin(), libs_required.end(), reqs )
682  != libs_required.end()) {
683  result = false;
684  }
685  disabled = true;
686  }
687 
688  if ( !site.IsLibOk(lib_info,true) && !site.Is3PartyLibWithChoice(reqs) ) {
689  disabled = true;
690  if (find( libs_required.begin(), libs_required.end(), reqs )
691  != libs_required.end()) {
692  if (unmet_req) {
693  if (!unmet_req->empty()) {
694  *unmet_req += ", ";
695  }
696  *unmet_req += reqs;
697  }
698  }
699  }
700  if (disabled) {
701  s_DisabledPackages[config.GetConfigFullName()].insert(reqs);
702  } else {
703  s_EnabledPackages[config.GetConfigFullName()].insert(reqs);
704  }
705  }
706 
707  return result;
708 }
709 
710 
711 const list<string> CMsvcPrjProjectContext::Defines(const SConfigInfo& cfg_info) const
712 {
713  list<string> defines(m_Defines);
714 
715  list<string> libs_list;
716  CreateLibsList(&libs_list);
717  ITERATE(list<string>, p, libs_list) {
718  const string& lib_id = *p;
719  if (GetApp().GetSite().Is3PartyLibWithChoice(lib_id)) {
720  if (GetApp().GetSite().GetChoiceFor3PartyLib(lib_id, cfg_info) == CMsvcSite::eLib) {
721  continue;
722  }
723  }
724  SLibInfo lib_info;
725  GetApp().GetSite().GetLibInfo(lib_id, cfg_info, &lib_info);
726  if ( !lib_info.m_LibDefines.empty() ) {
727  copy(lib_info.m_LibDefines.begin(),
728  lib_info.m_LibDefines.end(),
729  back_inserter(defines));
730  }
731  }
732  defines.sort();
733  defines.unique();
734  return defines;
735 }
736 
738 {
739  string value = GetConfigData("UsePch","UsePch",config);
740  if (value.empty()) {
741  return false;
742  }
743  return NStr::StringToBool(value);
744 }
745 
747  const string& project_id,
748  const string& source_file_full_path,
749  const string& tree_src_dir, const SConfigInfo& config) const
750 {
751  string value = m_MsvcProjectMakefile->GetConfigOpt("UsePch","DefaultPch",config);
752  if (value.empty()) {
753  if (!m_Project.m_Pch.empty()) {
754  try {
756  }
757  catch (...) {
758  return m_Project.m_Pch;
759  }
760  }
762  project_id, source_file_full_path, tree_src_dir);
763  }
764  return value;
765 }
766 
768  const string& section, const string& entry, const SConfigInfo& config) const
769 {
770  string value = m_MsvcProjectMakefile->GetConfigOpt(section,entry,config);
771  if (value.empty()) {
772  if (section == "UsePch" && entry == "UsePch" && !m_Project.m_Pch.empty()) {
773  try {
775  return m_Project.m_Pch;
776  }
777  catch (...) {
778  }
779  return "true";
780  }
781  value = GetApp().GetMetaMakefile().GetConfigOpt(section,entry,config);
782  }
783  return value;
784 }
785 
786 //-----------------------------------------------------------------------------
788  (const SConfigInfo& config,
789  const CMsvcPrjProjectContext& prj_context)
790  :m_Config (config),
791  m_MsvcMetaMakefile(GetApp().GetMetaMakefile())
792 {
793  //m_Type
794  switch ( prj_context.ProjectType() ) {
795  case CProjKey::eLib:
796  m_Type = eLib;
797  break;
798  case CProjKey::eApp:
799  m_Type = eExe;
800  break;
801  case CProjKey::eDll:
802  m_Type = eDll;
803  break;
804  case CProjKey::eDataSpec:
805  m_Type = eDataSpec;
806  break;
807  default:
808  m_Type = eOther;
809  break;
810  }
811 
812 
813  //m_OutputDirectory;
814  // /compilers/msvc7_prj/
815  string output_dir_abs = GetApp().GetProjectTreeInfo().m_Compilers;
816  output_dir_abs =
817  CDirEntry::ConcatPath(output_dir_abs,
818  GetApp().GetRegSettings().m_CompilersSubdir);
819  output_dir_abs =
820  CDirEntry::ConcatPath(output_dir_abs,
821  GetApp().GetBuildType().GetTypeStr());
822  if (m_Type == eLib)
823  output_dir_abs = CDirEntry::ConcatPath(output_dir_abs, "lib");
824  else if (m_Type == eExe)
825  output_dir_abs = CDirEntry::ConcatPath(output_dir_abs, "bin");
826  else if (m_Type == eDll) // same dir as exe
827  output_dir_abs = CDirEntry::ConcatPath(output_dir_abs, "bin");
828  else {
829  output_dir_abs = CDirEntry::ConcatPath(output_dir_abs, "lib");
830  }
831 
832  output_dir_abs =
837  output_dir_abs));
838 
839 #if 0
840 
841  const string project_tag(string(1,CDirEntry::GetPathSeparator()) +
842  "compilers" +
844  GetApp().GetRegSettings().m_CompilersSubdir +
846 
847  string project_dir = prj_context.ProjectDir();
848  string output_dir_prefix =
849  string (project_dir,
850  0,
851  project_dir.find(project_tag) + project_tag.length());
852 
853  output_dir_prefix =
854  CDirEntry::ConcatPath(output_dir_prefix,
855  GetApp().GetBuildType().GetTypeStr());
856 
857  if (m_Type == eLib)
858  output_dir_prefix = CDirEntry::ConcatPath(output_dir_prefix, "lib");
859  else if (m_Type == eExe)
860  output_dir_prefix = CDirEntry::ConcatPath(output_dir_prefix, "bin");
861  else if (m_Type == eDll) // same dir as exe
862  output_dir_prefix = CDirEntry::ConcatPath(output_dir_prefix, "bin");
863  else {
864  //TODO - handle Dll(s)
866  eProjectType, NStr::IntToString(m_Type));
867  }
868 
869  //output to ..static\DebugDLL or ..dll\DebugDLL
870  string output_dir_abs =
871  CDirEntry::ConcatPath(output_dir_prefix, config.GetConfigFullName());
873  CDirEntry::CreateRelativePath(project_dir, output_dir_abs);
874 #endif
875 }
876 
877 //------------------------------------------------------------------------------
879  (const CMsvcPrjGeneralContext& general_context,
880  const CMsvcPrjProjectContext& project_context);
881 
883  (const CMsvcPrjGeneralContext& general_context,
884  const CMsvcPrjProjectContext& project_context);
885 
887  (const CMsvcPrjGeneralContext& general_context,
888  const CMsvcPrjProjectContext& project_context);
889 
891  (const CMsvcPrjGeneralContext& general_context,
892  const CMsvcPrjProjectContext& project_context);
893 
895  (const CMsvcPrjGeneralContext& general_context,
896  const CMsvcPrjProjectContext& project_context);
897 
898 //-----------------------------------------------------------------------------
900  const CMsvcPrjProjectContext& project_context)
901 {
902  //configuration
903  m_Configuration.reset
904  (s_CreateConfiguration(general_context, project_context));
905  //compiler
906  m_Compiler.reset
907  (s_CreateCompilerTool(general_context, project_context));
908  //Linker:
909  m_Linker.reset(s_CreateLinkerTool(general_context, project_context));
910  //Librarian
912  (general_context, project_context));
913  //Dummies
915  m_MIDL.reset (new CMIDLToolDummyImpl());
917 
918  //Pre-build event - special case for LIB projects
919  if (project_context.ProjectType() == CProjKey::eLib) {
921  (project_context.PreBuilds(),
922  project_context.GetMakeType()));
923  } else if (project_context.ProjectType() == CProjKey::eDataSpec ||
924  project_context.ProjectType() == CProjKey::eUtility) {
926  } else {
927  m_PreBuildEvent.reset(new CPreBuildEventTool(project_context.PreBuilds(),
928  project_context.GetMakeType()));
929  }
931 
932  //Resource Compiler
934  (general_context,project_context));
935 
936  //Dummies
939 
940  m_XMLDataGenerator.reset
942 
945 
948 }
949 
950 
952 {
953  return m_Configuration.get();
954 }
955 
956 
958 {
959  return m_Compiler.get();
960 }
961 
962 
964 {
965  return m_Linker.get();
966 }
967 
968 
970 {
971  return m_Librarian.get();
972 }
973 
974 
976 {
977  return m_CustomBuid.get();
978 }
979 
980 
982 {
983  return m_MIDL.get();
984 }
985 
986 
988 {
989  return m_PostBuildEvent.get();
990 }
991 
992 
994 {
995  return m_PreBuildEvent.get();
996 }
997 
998 
1000 {
1001  return m_PreLinkEvent.get();
1002 }
1003 
1004 
1006 {
1007  return m_ResourceCompiler.get();
1008 }
1009 
1010 
1012 {
1013  return m_WebServiceProxyGenerator.get();
1014 }
1015 
1016 
1018 {
1019  return m_XMLDataGenerator.get();
1020 }
1021 
1022 
1024 {
1025  return m_ManagedWrapperGenerator.get();
1026 }
1027 
1028 
1031 {
1033 }
1034 
1035 
1037 {
1038 }
1039 
1040 
1041 static bool s_IsExe(const CMsvcPrjGeneralContext& general_context,
1042  const CMsvcPrjProjectContext& project_context)
1043 {
1044  return general_context.m_Type == CMsvcPrjGeneralContext::eExe;
1045 }
1046 
1047 
1048 static bool s_IsLib(const CMsvcPrjGeneralContext& general_context,
1049  const CMsvcPrjProjectContext& project_context)
1050 {
1051  return general_context.m_Type == CMsvcPrjGeneralContext::eLib;
1052 }
1053 
1054 static bool s_IsUtility(const CMsvcPrjGeneralContext& general_context,
1055  const CMsvcPrjProjectContext& project_context)
1056 {
1057  return general_context.m_Type == CMsvcPrjGeneralContext::eDataSpec ||
1058  general_context.m_Type == CMsvcPrjGeneralContext::eOther;
1059 }
1060 
1061 
1062 static bool s_IsDll(const CMsvcPrjGeneralContext& general_context,
1063  const CMsvcPrjProjectContext& project_context)
1064 {
1065  return general_context.m_Type == CMsvcPrjGeneralContext::eDll;
1066 }
1067 
1068 
1069 static bool s_IsDebug(const CMsvcPrjGeneralContext& general_context,
1070  const CMsvcPrjProjectContext& project_context)
1071 {
1072  return general_context.m_Config.m_Debug;
1073 }
1074 
1075 
1076 static bool s_IsRelease(const CMsvcPrjGeneralContext& general_context,
1077  const CMsvcPrjProjectContext& project_context)
1078 {
1079  return !(general_context.m_Config.m_Debug);
1080 }
1081 
1082 
1083 //-----------------------------------------------------------------------------
1084 // Creators:
1085 static IConfiguration*
1087  const CMsvcPrjProjectContext& project_context)
1088 {
1089  if ( s_IsExe(general_context, project_context) )
1090  return new CConfigurationImpl<SApp>
1091  (general_context.OutputDirectory(),
1092  general_context.ConfigurationName(),
1093  project_context.GetMsvcProjectMakefile(),
1094  general_context.GetMsvcMetaMakefile(),
1095  general_context.m_Config );
1096 
1097  if ( s_IsLib(general_context, project_context) )
1098  return new CConfigurationImpl<SLib>
1099  (general_context.OutputDirectory(),
1100  general_context.ConfigurationName(),
1101  project_context.GetMsvcProjectMakefile(),
1102  general_context.GetMsvcMetaMakefile(),
1103  general_context.m_Config );
1104 
1105  if ( s_IsUtility(general_context, project_context) )
1106  return new CConfigurationImpl<SUtility>
1107  (general_context.OutputDirectory(),
1108  general_context.ConfigurationName(),
1109  project_context.GetMsvcProjectMakefile(),
1110  general_context.GetMsvcMetaMakefile(),
1111  general_context.m_Config );
1112 
1113  if ( s_IsDll(general_context, project_context) )
1114  return new CConfigurationImpl<SDll>
1115  (general_context.OutputDirectory(),
1116  general_context.ConfigurationName(),
1117  project_context.GetMsvcProjectMakefile(),
1118  general_context.GetMsvcMetaMakefile(),
1119  general_context.m_Config );
1120  return NULL;
1121 }
1122 
1123 
1124 static ICompilerTool*
1126  const CMsvcPrjProjectContext& project_context)
1127 {
1128  return new CCompilerToolImpl
1129  (project_context.AdditionalIncludeDirectories(general_context.m_Config),
1130  project_context.GetMsvcProjectMakefile(),
1131  general_context.m_Config.m_RuntimeLibrary,
1132  general_context.GetMsvcMetaMakefile(),
1133  general_context.m_Config,
1134  general_context.m_Type,
1135  project_context.Defines(general_context.m_Config),
1136  project_context.ProjectId());
1137 }
1138 
1139 
1140 static ILinkerTool*
1142  const CMsvcPrjProjectContext& project_context)
1143 {
1144  //---- EXE ----
1145  if ( s_IsExe (general_context, project_context) )
1146  return new CLinkerToolImpl<SApp>
1147  (project_context.AdditionalLinkerOptions
1148  (general_context.m_Config),
1149  project_context.AdditionalLibraryDirectories
1150  (general_context.m_Config),
1151  project_context.ProjectId(),
1152  project_context.GetMsvcProjectMakefile(),
1153  general_context.GetMsvcMetaMakefile(),
1154  general_context.m_Config);
1155 
1156 
1157  //---- LIB ----
1158  if ( s_IsLib(general_context, project_context) ||
1159  s_IsUtility(general_context, project_context) )
1160  return new CLinkerToolDummyImpl();
1161 
1162  //---- DLL ----
1163  if ( s_IsDll (general_context, project_context) )
1164  return new CLinkerToolImpl<SDll>
1165  (project_context.AdditionalLinkerOptions
1166  (general_context.m_Config),
1167  project_context.AdditionalLibraryDirectories
1168  (general_context.m_Config),
1169  project_context.ProjectId(),
1170  project_context.GetMsvcProjectMakefile(),
1171  general_context.GetMsvcMetaMakefile(),
1172  general_context.m_Config);
1173 
1174  // unsupported tool
1175  return NULL;
1176 }
1177 
1178 
1179 static ILibrarianTool*
1181  const CMsvcPrjProjectContext& project_context)
1182 {
1183  if ( s_IsLib (general_context, project_context) )
1184  return new CLibrarianToolImpl
1185  (project_context.ProjectId(),
1186  project_context.GetMsvcProjectMakefile(),
1187  general_context.GetMsvcMetaMakefile(),
1188  general_context.m_Config);
1189 
1190  // dummy tool
1191  return new CLibrarianToolDummyImpl();
1192 }
1193 
1194 
1196  (const CMsvcPrjGeneralContext& general_context,
1197  const CMsvcPrjProjectContext& project_context)
1198 {
1199 
1200  if ( s_IsDll (general_context, project_context) &&
1201  s_IsDebug(general_context, project_context) )
1203  (project_context.AdditionalIncludeDirectories(general_context.m_Config),
1204  project_context.GetMsvcProjectMakefile(),
1205  general_context.GetMsvcMetaMakefile(),
1206  general_context.m_Config);
1207 
1208  if ( s_IsDll (general_context, project_context) &&
1209  s_IsRelease(general_context, project_context) )
1211  (project_context.AdditionalIncludeDirectories(general_context.m_Config),
1212  project_context.GetMsvcProjectMakefile(),
1213  general_context.GetMsvcMetaMakefile(),
1214  general_context.m_Config);
1215 
1216  if ( s_IsExe (general_context, project_context) &&
1217  s_IsDebug(general_context, project_context) )
1219  (project_context.AdditionalIncludeDirectories(general_context.m_Config),
1220  project_context.GetMsvcProjectMakefile(),
1221  general_context.GetMsvcMetaMakefile(),
1222  general_context.m_Config);
1223 
1224 
1225  if ( s_IsExe (general_context, project_context) &&
1226  s_IsRelease(general_context, project_context) )
1228  (project_context.AdditionalIncludeDirectories(general_context.m_Config),
1229  project_context.GetMsvcProjectMakefile(),
1230  general_context.GetMsvcMetaMakefile(),
1231  general_context.m_Config);
1232 
1233 
1234  // dummy tool
1235  return new CResourceCompilerToolDummyImpl();
1236 }
1237 
1238 
CCompilerToolImpl –.
CConfigurationImpl –.
CDirEntry –.
Definition: ncbifile.hpp:262
CFileException –.
Definition: ncbifile.hpp:136
CLibrarianToolDummyImpl –.
CLibrarianToolImpl –.
CLinkerToolDummyImpl –.
CLinkerToolImpl –.
static EMsvcPlatform GetMsvcPlatform(void)
static string GetMsvcSection(void)
static string GetConfigNameKeyword(void)
Combining of rules and project makefile.
virtual void GetInlinesInSrc(const SConfigInfo &config, list< string > *files) const
virtual void GetCustomBuildInfo(list< SCustomBuildInfo > *info) const
virtual void GetHeadersInInclude(const SConfigInfo &config, list< string > *files) const
virtual void GetAdditionalIncludeDirs(const SConfigInfo &config, list< string > *files) const
virtual void GetInlinesInInclude(const SConfigInfo &config, list< string > *files) const
virtual void GetHeadersInSrc(const SConfigInfo &config, list< string > *files) const
string GetUsePchThroughHeader(const string &project_id, const string &source_file_full_path, const string &tree_src_dir) const
string GetConfigOpt(const string &section, const string &opt, const SConfigInfo &config) const
CMsvcPrjGeneralContext –.
string OutputDirectory(void) const
const CMsvcMetaMakefile & GetMsvcMetaMakefile(void) const
string ConfigurationName(void) const
CMsvcPrjGeneralContext(void)
Prohibited to:
CMsvcPrjProjectContext –.
string AdditionalLinkerOptions(const SConfigInfo &cfg_info) const
string GetConfigData(const string &section, const string &entry, const SConfigInfo &config) const
bool IsConfigEnabled(const SConfigInfo &config, string *unmet, string *unmet_req) const
string AdditionalLibraryDirectories(const SConfigInfo &cfg_info) const
bool IsPchEnabled(const SConfigInfo &config) const
static map< string, set< string > > s_EnabledPackages
const list< CProjKey > & PreBuilds(void) const
list< SCustomBuildInfo > m_CustomBuildInfo
string AdditionalIncludeDirectories(const SConfigInfo &cfg_info) const
unique_ptr< CMsvcProjectMakefile > m_MsvcProjectMakefile
const string & ProjectDir(void) const
static map< string, set< string > > s_DisabledPackages
void CreateLibsList(list< string > *libs_list) const
unique_ptr< CMsvcCombinedProjectMakefile > m_MsvcCombinedProjectMakefile
string GetPchHeader(const string &project_id, const string &source_file_full_path, const string &tree_src_dir, const SConfigInfo &config) const
static bool IsRequiresOk(const CProjItem &prj, string *unmet)
const list< string > Defines(const SConfigInfo &cfg_info) const
EMakeFileType GetMakeType(void) const
CProjItem::TProjType ProjectType(void) const
const string & ProjectId(void) const
CProjItem::TProjType m_ProjType
const CMsvcCombinedProjectMakefile & GetMsvcProjectMakefile(void) const
CMsvcProjectMakefile –.
CMsvcSite –.
Definition: msvc_site.hpp:131
void GetLibInclude(const string &lib_id, const SConfigInfo &cfg_info, list< string > *includes) const
Definition: msvc_site.cpp:641
void GetThirdPartyLibsToInstall(list< string > *libs) const
Definition: msvc_site.cpp:695
void GetLibInfo(const string &lib, const SConfigInfo &config, SLibInfo *libinfo) const
Definition: msvc_site.cpp:333
void GetComponents(const string &entry, list< string > *components) const
Get components from site.
Definition: msvc_site.cpp:290
unique_ptr< ILibrarianTool > m_Librarian
IManagedWrapperGeneratorTool * ManagedWrapperGenerator(void) const
ICustomBuildTool * CustomBuid(void) const
ILinkerTool * Linker(void) const
IXMLDataGeneratorTool * XMLDataGenerator(void) const
IPostBuildEventTool * PostBuildEvent(void) const
unique_ptr< IPostBuildEventTool > m_PostBuildEvent
unique_ptr< IMIDLTool > m_MIDL
unique_ptr< IManagedWrapperGeneratorTool > m_ManagedWrapperGenerator
unique_ptr< IXMLDataGeneratorTool > m_XMLDataGenerator
unique_ptr< IResourceCompilerTool > m_ResourceCompiler
unique_ptr< IConfiguration > m_Configuration
IPreLinkEventTool * PreLinkEvent(void) const
ILibrarianTool * Librarian(void) const
unique_ptr< IPreBuildEventTool > m_PreBuildEvent
IWebServiceProxyGeneratorTool * WebServiceProxyGenerator(void) const
unique_ptr< IAuxiliaryManagedWrapperGeneratorTool > m_AuxiliaryManagedWrapperGenerator
ICompilerTool * Compiler(void) const
IAuxiliaryManagedWrapperGeneratorTool * AuxiliaryManagedWrapperGenerator(void) const
unique_ptr< ICustomBuildTool > m_CustomBuid
IMIDLTool * MIDL(void) const
unique_ptr< ILinkerTool > m_Linker
unique_ptr< IPreLinkEventTool > m_PreLinkEvent
unique_ptr< IWebServiceProxyGeneratorTool > m_WebServiceProxyGenerator
IConfiguration * Configuration(void) const
IResourceCompilerTool * ResourceCompiler(void) const
IPreBuildEventTool * PreBuildEvent(void) const
unique_ptr< ICompilerTool > m_Compiler
CProjBulderAppException –.
const CProjectItemsTree * GetCurrentBuildTree(void) const
const CMsvcMetaMakefile & GetMetaMakefile(void)
const CProjectItemsTree * GetIncompleteBuildTree(void) const
const SProjectTreeInfo & GetProjectTreeInfo(void)
const string & GetBuildRoot(void) const
const CMsvcSite & GetSite(void)
CProjItem –.
Definition: proj_item.hpp:54
list< string > m_Requires
What this project requires to have (in user site).
Definition: proj_item.hpp:106
list< string > m_IncludeDirs
Resolved contents of CPPFLAG ( -I<m_IncludeDir> -I/..) Absolute pathes.
Definition: proj_item.hpp:113
list< string > m_Sources
List of source files without extension ( *.cpp or *.c ) - with relative pathes from m_SourcesBaseDir.
Definition: proj_item.hpp:99
set< CProjKey > m_UnconditionalDepends
Definition: proj_item.hpp:103
list< CProjKey > m_Depends
What projects this project is depend upon (IDs).
Definition: proj_item.hpp:102
TProjType m_ProjType
Type of the project.
Definition: proj_item.hpp:89
EMakeFileType m_MakeType
Type of the project.
Definition: proj_item.hpp:125
string m_ID
ID of atomic project.
Definition: proj_item.hpp:86
list< string > m_Defines
Defines like USE_MS_DBLIB.
Definition: proj_item.hpp:119
list< string > m_Inlines
Definition: proj_item.hpp:141
string m_Pch
Precompiled header.
Definition: proj_item.hpp:95
list< string > m_Includes
Definition: proj_item.hpp:140
list< string > m_NcbiCLibs
Libraries from NCBI C Toolkit to link with.
Definition: proj_item.hpp:122
list< string > m_Libs3Party
Resolved contents of LIBS flag (Third-party libs)
Definition: proj_item.hpp:109
string m_SourcesBaseDir
Base directory of source files (....c++/src/a/ )
Definition: proj_item.hpp:92
CProjKey –.
const string & Id(void) const
Definition: proj_item.cpp:112
TProjType Type(void) const
Definition: proj_item.cpp:106
CProjectItemsTree –.
Definition: proj_tree.hpp:54
TProjects m_Projects
Definition: proj_tree.hpp:70
CResourceCompilerToolImpl –.
CResourceCompilerToolImpl –.
static bool IsDefine(const string &param)
Definition: resolver.cpp:258
Dummy (name-only) tool implementations.
const_iterator end() const
Definition: map.hpp:152
iterator_bool insert(const value_type &val)
Definition: map.hpp:165
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: map.hpp:338
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
const_iterator begin() const
Definition: set.hpp:135
const_iterator end() const
Definition: set.hpp:136
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)
Normalize a path.
Definition: ncbifile.cpp:820
string GetDir(EIfEmptyPath mode=eIfEmptyPath_Current) const
Get the directory component for this directory entry.
Definition: ncbifile.cpp:475
virtual bool Exists(void) const
Check the entry existence.
Definition: ncbifile.cpp:2325
static string AddTrailingPathSeparator(const string &path)
Add trailing path separator, if needed.
Definition: ncbifile.cpp:455
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.
Definition: ncbifile.cpp:599
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
Definition: ncbifile.cpp:433
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
Definition: ncbifile.cpp:776
string GetName(void) const
Get the base entry name with extension (if any).
Definition: ncbifile.hpp:3917
static void SplitPath(const string &path, string *dir=0, string *base=0, string *ext=0)
Split a path string into its basic components.
Definition: ncbifile.cpp:358
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static bool StringToBool(const CTempString str)
Convert string to bool.
Definition: ncbistr.cpp:2812
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
Definition: ncbistr.cpp:219
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5086
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2699
int i
yy_size_t n
string GetDllHost(const CProjectItemsTree &tree, const string &lib)
string CreateMsvcProjectMakefileName(const string &project_name, CProjItem::TProjType type)
Create project makefile name.
#define MSVC_DEFAULT_LIBS_TAG
bool SameRootDirs(const string &dir1, const string &dir2)
Checks if 2 dirs has the same root.
string CreateProjectName(const CProjKey &project_id)
Project naming schema.
static ILibrarianTool * s_CreateLibrarianTool(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static bool s_IsExe(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static bool s_IsLib(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static bool s_IsUtility(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static IResourceCompilerTool * s_CreateResourceCompilerTool(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static bool s_IsRelease(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static IConfiguration * s_CreateConfiguration(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static ICompilerTool * s_CreateCompilerTool(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static bool s_IsDebug(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static bool s_IsDll(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
static ILinkerTool * s_CreateLinkerTool(const CMsvcPrjGeneralContext &general_context, const CMsvcPrjProjectContext &project_context)
const TYPE & Get(const CNamedParameterList *param)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
EIPRangeType t
Definition: ncbi_localip.c:101
ESERV_Site site
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
CProjBulderApp & GetApp(void)
access to App singleton
#define PTB_ERROR_EX(file, err_code, msg)
@ ePTB_ProjectNotFound
@ ePTB_FileNotFound
#define PTB_WARNING_EX(file, err_code, msg)
ICompilerTool –.
IConfiguration –.
Dummies - Name - only tools. Must present in msvc proj:
ILibrarianTool –.
ILinkerTool –.
Not a dummy for lib projects.
IResourceCompilerTool –.
Dummies - Name - only tools. Must present in msvc proj:
SConfigInfo –.
string m_RuntimeLibrary
string GetConfigFullName(void) const
SLibInfo –.
Definition: msvc_site.hpp:48
bool IsEmpty(void) const
Definition: msvc_site.hpp:95
list< string > m_Libs
Definition: msvc_site.hpp:54
list< string > m_StdLibs
Definition: msvc_site.hpp:55
list< string > m_LibDefines
Definition: msvc_site.hpp:51
list< string > m_Macro
Definition: msvc_site.hpp:56
string m_LibPath
Definition: msvc_site.hpp:52
static bool IsConfigurableDefine(const string &define)
string m_Compilers
<compilers> branch of tree
Definition: proj_utils.hpp:74
else result
Definition: token2.c:20
Modified on Mon Jul 22 05:05:57 2024 by modify_doxy.py rev. 669887