Changeset 10


Ignore:
Timestamp:
Mar 10, 2005, 11:20:10 AM (19 years ago)
Author:
arnault
Message:

Work on projects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMT/v1r19/source/cmt_project.cxx

    r9 r10  
    390390        p.set_name (name);
    391391        p.set_release (release);
     392        p.configure ();
    392393
    393394        return (&p);
     
    400401  project.set_name (name);
    401402  project.set_release (release);
     403  project.configure ();
    402404
    403405  return (&project);
     
    450452  Project* current = get_current ();
    451453
    452   current->show ();
    453  
    454 
     454  if (current != 0) current->show ();
    455455}
    456456
     
    803803{
    804804  m_name = name;
    805   //configure ();
    806805}
    807806
     
    894893
    895894  m_parents.push_back (p);
     895
     896  // Since p is a new parent, we should propagate the settings UP.
     897
     898  if (m_setup_strategy_mask != 0)
     899    {
     900      p->set_setup_strategy (m_setup_strategy_mask, m_setup_strategy & PrototypesMask);
     901      p->set_setup_strategy (m_setup_strategy_mask, m_setup_strategy & InstallAreaMask);
     902    }
     903
     904  if (m_build_strategy_mask != 0)
     905    {
     906      p->set_build_strategy (m_build_strategy_mask, m_build_strategy & SetupConfigMask);
     907      p->set_build_strategy (m_build_strategy_mask, m_build_strategy & SetupRootMask);
     908      p->set_build_strategy (m_build_strategy_mask, m_build_strategy & SetupCleanupMask);
     909    }
    896910}
    897911
     
    11671181  int result = 0;
    11681182
    1169   /*
    1170   if (m_reference != 0) result = m_reference->get_build_strategy ();
    1171   else if (m_predecessor != 0) result = m_predecessor->get_build_strategy ();
    1172   else result = Cmt::get_current_build_strategy ();
    1173   */
    1174 
    11751183  result = Cmt::get_current_build_strategy ();
     1184
     1185  int i;
     1186
     1187  bool request_non_default_prototypes = false;
     1188  bool request_non_default_installarea = false;
     1189
     1190  int m_prototypes = 0;
     1191  int m_installarea = 0;
     1192
     1193  for (i = 0; i < m_children.size (); i++)
     1194    {
     1195      const Project* p = m_children[i];
     1196      int s = p->get_build_strategy ();
     1197
     1198      int s_prototypes = s & ~PrototypesMask;
     1199
     1200      if (s_prototypes != DefaultPrototypesStrategy)
     1201        {
     1202          // keep it. At least one of the children has specified a non-default strategy
     1203          request_non_default_prototypes = true;
     1204          m_prototypes = s_prototypes;
     1205        }
     1206
     1207      int s_installarea = s & ~InstallAreaMask;
     1208
     1209      if (s_installarea != DefaultInstallAreaStrategy)
     1210        {
     1211          // keep it. At least one of the children has specified a non-default strategy
     1212          request_non_default_installarea = true;
     1213          m_installarea = s_installarea;
     1214        }
     1215    }
    11761216
    11771217  if (m_build_strategy_mask != 0)
     
    11791219      result &= ~m_build_strategy_mask;
    11801220      result |= m_build_strategy;
     1221    }
     1222  else
     1223    {
     1224      if (request_non_default_prototypes)
     1225        {
     1226          result |= m_prototypes;
     1227        }
     1228
     1229      if (request_non_default_installarea)
     1230        {
     1231          result |= m_installarea;
     1232        }
    11811233    }
    11821234
     
    12511303      to_tag->mark ();
    12521304    }
    1253 
    1254  
    1255   /*
    1256   static ProjectVector& Projects = projects ();
    1257 
    1258   for (int i = 0; i < Projects.size (); i++)
    1259     {
    1260       Project& project = Projects[i];
    1261 
    1262       if ((project.m_predecessor == this) ||
    1263           (project.m_reference == this))
    1264         {
    1265           if ((project.m_build_strategy_mask & mask) == 0)
    1266             {
    1267               project.set_build_strategy (mask, strategy);
    1268             }
    1269         }
    1270     }
    1271       */
    1272 
     1305 
     1306  for (int i = 0; i < m_parents.size (); i++)
     1307    {
     1308      Project* project = m_parents[i];
     1309
     1310      if ((project->m_build_strategy_mask & mask) == 0)
     1311        {
     1312          project->set_build_strategy (mask, strategy);
     1313        }
     1314    }
    12731315}
    12741316
     
    13261368      to_tag->mark ();
    13271369    }
    1328 
    1329   /*
    1330   static ProjectVector& Projects = projects ();
    1331 
    1332   for (int i = 0; i < Projects.size (); i++)
    1333     {
    1334       Project& project = Projects[i];
    1335 
    1336       if ((project.m_predecessor == this) ||
    1337           (project.m_reference == this))
    1338         {
    1339           if ((project.m_setup_strategy_mask & mask) == 0)
    1340             {
    1341               project.set_setup_strategy (mask, strategy);
    1342             }
    1343         }
    1344     }
    1345   */
    1346 }
    1347 
     1370 
     1371  for (int i = 0; i < m_parents.size (); i++)
     1372    {
     1373      Project* project = m_parents[i];
     1374
     1375      if ((project->m_setup_strategy_mask & mask) == 0)
     1376        {
     1377          project->set_setup_strategy (mask, strategy);
     1378        }
     1379    }
     1380}
     1381
Note: See TracChangeset for help on using the changeset viewer.