Changeset 81


Ignore:
Timestamp:
Sep 1, 2005, 10:34:42 AM (19 years ago)
Author:
arnault
Message:

moving get_strategy to cmt_use - see CL#276

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r80 r81  
    112005-09-01  Christian Arnault  <arnault@lal.in2p3.fr> 276
    22
    3         * source/cmt_symbol.cxx (all_set): Generate all XXXROOT and XXXCONFIG evs accroding
     3        * source/cmt_use.cxx (get_strategy): Implement the get_strategy function
     4
     5        * source/cmt_use.h (class Use): Install the get_strategy function as a member function.
     6
     7        * source/cmt_symbol.cxx (all_set): Generate all XXXROOT and XXXCONFIG evs according
    48        to the strategies.
    59
  • CMT/HEAD/source/cmt.h

    r80 r81  
    211211  static CmtScopeFilteringMode get_scope_filtering_mode ();
    212212  static bool get_all_sets_done ();
    213   static bool get_strategy (const cmt_string& name, Use& use);
    214213
    215214  /// If a project file exists above the current directory we don't need CMTPATH
  • CMT/HEAD/source/cmt_parser.cxx

    r80 r81  
    150150  int m_count;
    151151};
    152 
    153 
    154 //----------------------------------------------------------
    155 bool Cmt::get_strategy (const cmt_string& name, Use& use)
    156 {
    157   static cmt_string cmtpath;
    158   static cmt_string offset;
    159 
    160   use.get_cmtpath_and_offset (cmtpath, offset);
    161 
    162   Project* p = Project::find_by_cmtpath (cmtpath);
    163 
    164   bool strategy;
    165 
    166   if (p == 0)
    167     {
    168       static const Project::ProjectVector& projects = Project::projects ();
    169 
    170       if (projects.size () == 0) strategy = StrategyMgr::get_default_strategy (name);
    171       else
    172         {
    173           p = &(projects[0]);
    174           strategy = p->get_strategy (name);
    175         }
    176     }
    177   else
    178     {
    179       strategy = p->get_strategy (name);
    180     }
    181 
    182   return (strategy);
    183 }
    184152
    185153//----------------------------------------------------------
     
    17411709  }
    17421710
    1743   if (get_strategy ("InstallArea", current_use))
     1711  if (current_use.get_strategy ("InstallArea"))
    17441712    {
    17451713      const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
     
    21652133    //  Try a cleanup of the installation area
    21662134    //
    2167   if (get_strategy ("InstallArea", current_use))
     2135  if (current_use.get_strategy ("InstallArea"))
    21682136    {
    21692137      CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
     
    21712139      //cout << "#IA3>" << endl;
    21722140
    2173       if (get_strategy ("SetupCleanup", Use::current ()))
     2141      if (current_use.get_strategy ("SetupCleanup"))
    21742142        {
    21752143          ia_mgr.config ();
     
    29032871              Symbol::expand (libname);
    29042872
    2905               if (get_strategy ("InstallArea", current_use))
     2873              if (current_use.get_strategy ("InstallArea"))
    29062874                {
    29072875                  const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
     
    31033071    //  Try a cleanup of the installation area
    31043072    //
    3105   if (get_strategy ("InstallArea", current_use))
     3073  if (current_use.get_strategy ("InstallArea"))
    31063074    {
    31073075      CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
     
    31123080
    31133081      /*
    3114       if (get_strategy ("SetupCleanup", current_use))
     3082      if (current_use.get_strategy ("SetupCleanup"))
    31153083        {
    31163084          const cmt_string& installarea = ia_mgr.get_installarea ();
     
    36793647  cout << "Build strategy    : ";
    36803648
    3681   if (get_strategy ("BuildPrototypes", current_use))
     3649  if (current_use.get_strategy ("BuildPrototypes"))
    36823650    {
    36833651      cout << "prototypes";
     
    36883656    }
    36893657 
    3690   if (get_strategy ("InstallArea", current_use))
     3658  if (current_use.get_strategy ("InstallArea"))
    36913659    {
    36923660      cout << " with_installarea";
     
    37013669  cout << "Setup strategy    : ";
    37023670 
    3703   if (get_strategy ("SetupConfig", current_use))
     3671  if (current_use.get_strategy ("SetupConfig"))
    37043672    {
    37053673      cout << "config";
     
    37103678    }
    37113679 
    3712   if (get_strategy ("SetupRoot", current_use))
     3680  if (current_use.get_strategy ("SetupRoot"))
    37133681    {
    37143682      cout << " root";
     
    37193687    }
    37203688 
    3721   if (get_strategy ("SetupCleanup", current_use))
     3689  if (current_use.get_strategy ("SetupCleanup"))
    37223690    {
    37233691      cout << " cleanup";
     
    41804148  cmt_string no_cleanup_opt;
    41814149
    4182   if (get_strategy ("SetupCleanup", current_use))
     4150  if (current_use.get_strategy ("SetupCleanup"))
    41834151    {
    41844152      no_cleanup_opt = " -no_cleanup";
     
    43744342  cmt_string no_cleanup_opt;
    43754343
    4376   if (get_strategy ("SetupCleanup", current_use))
     4344  if (current_use.get_strategy ("SetupCleanup"))
    43774345    {
    43784346      no_cleanup_opt = " -no_cleanup";
     
    47134681{
    47144682  Use& current_use = Use::current ();
    4715   if (get_strategy ("BuildPrototypes", current_use)) return (true);
     4683
     4684  if (current_use.get_strategy ("BuildPrototypes")) return (true);
    47164685  else return (false);
    47174686}
     
    57565725  cmt_string system = CmtSystem::get_cmt_config ();
    57575726
    5758   bool do_config = get_strategy ("SetupConfig", use);
    5759   bool do_root = get_strategy ("SetupRoot", use);
     5727  bool do_config = use.get_strategy ("SetupConfig");
     5728  bool do_root = use.get_strategy ("SetupRoot");
    57605729
    57615730  switch (mode)
     
    73047273    CmtPathPattern::apply_all ();
    73057274
    7306     if (Cmt::get_strategy ("InstallArea", Use::current ()))
     7275    const Use& current_use = Use::current ();
     7276
     7277    if (current_use.get_strategy ("InstallArea"))
    73077278      {
    73087279        CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
     
    74387409    //
    74397410  /*
    7440   if (get_strategy ("InstallArea", Use::current ()))
     7411  if (current_use.get_strategy ("InstallArea"))
    74417412    {
    74427413      CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
  • CMT/HEAD/source/cmt_symbol.cxx

    r80 r81  
    12941294          if (use.get_package_name () == "cmt_standalone") continue;
    12951295
    1296           if (Cmt::get_strategy ("SetupConfig", use))
     1296          if (use.get_strategy ("SetupConfig"))
    12971297            {
    12981298              cmt_string& temp = envs.add ();
     
    13031303            }
    13041304
    1305           if (Cmt::get_strategy ("SetupRoot", use))
     1305          if (use.get_strategy ("SetupRoot"))
    13061306            {
    13071307              cmt_string& temp = envs.add ();
     
    13191319    if (use.get_package_name () != "cmt_standalone")
    13201320      {
    1321         if (Cmt::get_strategy ("SetupConfig", use))
     1321        if (use.get_strategy ("SetupConfig"))
    13221322          {
    13231323            cmt_string& temp = envs.add ();
     
    13281328          }
    13291329       
    1330         if (Cmt::get_strategy ("SetupRoot", use))
     1330        if (use.get_strategy ("SetupRoot"))
    13311331          {
    13321332            cmt_string& temp = envs.add ();
  • CMT/HEAD/source/cmt_use.cxx

    r78 r81  
    28762876}
    28772877
     2878//------------------------------------------------------------
     2879bool Use::get_strategy (const cmt_string& name) const
     2880{
     2881  Project* p = Project::find_by_cmtpath (real_path);
     2882
     2883  bool strategy;
     2884
     2885  if (p == 0)
     2886    {
     2887      static const Project::ProjectVector& projects = Project::projects ();
     2888
     2889      if (projects.size () == 0) strategy = StrategyMgr::get_default_strategy (name);
     2890      else
     2891        {
     2892          p = &(projects[0]);
     2893          strategy = p->get_strategy (name);
     2894        }
     2895    }
     2896  else
     2897    {
     2898      strategy = p->get_strategy (name);
     2899    }
     2900
     2901  return (strategy);
     2902}
     2903
    28782904//----------------------------------------------------------
    28792905void Use::fill_includes_macro (cmt_string& buffer) const
  • CMT/HEAD/source/cmt_use.h

    r11 r81  
    8989  void reduce_path (cmt_string& s) const;
    9090  void get_cmtpath_and_offset (cmt_string& cmtpath, cmt_string& offset) const;
     91  bool get_strategy (const cmt_string& name) const;
    9192
    9293  void fill_includes_macro (cmt_string& buffer) const;
Note: See TracChangeset for help on using the changeset viewer.