~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/sdk/projectloader.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3
3
 * http://www.gnu.org/licenses/lgpl-3.0.html
4
4
 *
5
 
 * $Revision: 4909 $
6
 
 * $Id: projectloader.cpp 4909 2008-02-27 13:15:26Z mortenmacfly $
7
 
 * $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/sdk/projectloader.cpp $
 
5
 * $Revision: 5497 $
 
6
 * $Id: projectloader.cpp 5497 2009-04-02 22:07:24Z jenslody $
 
7
 * $HeadURL: svn+ssh://jenslody@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/sdk/projectloader.cpp $
8
8
 */
9
9
 
10
10
#include "sdk_precomp.h"
342
342
    node = parentNode->FirstChildElement("DistClean");
343
343
    if (node && node->Attribute("command"))
344
344
        target->SetMakeCommandFor(mcDistClean, cbC2U(node->Attribute("command")));
 
345
 
 
346
    node = parentNode->FirstChildElement("AskRebuildNeeded");
 
347
    if (node && node->Attribute("command"))
 
348
        target->SetMakeCommandFor(mcAskRebuildNeeded, cbC2U(node->Attribute("command")));
 
349
 
 
350
    node = parentNode->FirstChildElement("SilentBuild");
 
351
    if (node && node->Attribute("command"))
 
352
        target->SetMakeCommandFor(mcSilentBuild, cbC2U(node->Attribute("command")));
345
353
}
346
354
 
347
355
void ProjectLoader::DoVirtualTargets(TiXmlElement* parentNode)
377
385
    wxString title;
378
386
    wxString makefile;
379
387
    bool makefile_custom = false;
 
388
    wxString execution_dir;
380
389
    wxString defaultTarget;
381
390
    wxString compilerId = _T("gcc");
382
391
    bool extendedObjectNames = false;
405
414
        else if (node->Attribute("makefile_is_custom"))
406
415
            makefile_custom = strncmp(node->Attribute("makefile_is_custom"), "1", 1) == 0;
407
416
 
 
417
        else if (node->Attribute("execution_dir"))
 
418
            execution_dir = cbC2U(node->Attribute("execution_dir"));
 
419
 
408
420
        // old default_target (int) node
409
421
        else if (node->QueryIntAttribute("default_target", &m_1_4_to_1_5_deftarget) == TIXML_SUCCESS)
410
422
        {
442
454
    m_pProject->SetPlatforms(platformsFinal);
443
455
    m_pProject->SetMakefile(makefile);
444
456
    m_pProject->SetMakefileCustom(makefile_custom);
 
457
    m_pProject->SetMakefileExecutionDir(execution_dir);
445
458
    m_pProject->SetDefaultExecuteTarget(defaultTarget);
446
459
    m_pProject->SetCompilerID(compilerId);
447
460
    m_pProject->SetExtendedObjectNamesGeneration(extendedObjectNames);
1070
1083
        AddElement(prjnode, "Option", "makefile", m_pProject->GetMakefile());
1071
1084
    if (m_pProject->IsMakefileCustom())
1072
1085
        AddElement(prjnode, "Option", "makefile_is_custom", 1);
 
1086
    if (m_pProject->GetMakefileExecutionDir() != m_pProject->GetBasePath())
 
1087
        AddElement(prjnode, "Option", "execution_dir", m_pProject->GetMakefileExecutionDir());
1073
1088
    if (m_pProject->GetModeForPCH() != pchObjectDir)
1074
1089
        AddElement(prjnode, "Option", "pch_mode", (int)m_pProject->GetModeForPCH());
1075
1090
    if (!m_pProject->GetDefaultExecuteTarget().IsEmpty() && m_pProject->GetDefaultExecuteTarget() != m_pProject->GetFirstValidBuildTargetName())
1098
1113
        AddElement(makenode, "CompileFile", "command", m_pProject->GetMakeCommandFor(mcCompileFile));
1099
1114
        AddElement(makenode, "Clean", "command", m_pProject->GetMakeCommandFor(mcClean));
1100
1115
        AddElement(makenode, "DistClean", "command", m_pProject->GetMakeCommandFor(mcDistClean));
 
1116
        AddElement(makenode, "AskRebuildNeeded", "command", m_pProject->GetMakeCommandFor(mcAskRebuildNeeded));
 
1117
        AddElement(makenode, "SilentBuild", "command", m_pProject->GetMakeCommandFor(mcSilentBuild));
1101
1118
    }
1102
1119
 
1103
1120
    prjnode->InsertEndChild(TiXmlElement("Build"));
1225
1242
            AddElement(makenode, "CompileFile", "command", target->GetMakeCommandFor(mcCompileFile));
1226
1243
            AddElement(makenode, "Clean", "command", target->GetMakeCommandFor(mcClean));
1227
1244
            AddElement(makenode, "DistClean", "command", target->GetMakeCommandFor(mcDistClean));
 
1245
            AddElement(makenode, "AskRebuildNeeded", "command", target->GetMakeCommandFor(mcAskRebuildNeeded));
 
1246
            AddElement(makenode, "SilentBuild", "command", target->GetMakeCommandFor(mcSilentBuild));
1228
1247
        }
1229
1248
    }
1230
1249
 
1284
1303
        ProjectFile* f = m_pProject->GetFile(i);
1285
1304
 
1286
1305
        // do not save auto-generated files
1287
 
        if (f->autoGeneratedBy)
 
1306
        if (f->AutoGeneratedBy())
 
1307
        {
1288
1308
            continue;
1289
 
 
 
1309
        }
1290
1310
        // do not save project files that do not belong in the target we 're exporting
1291
1311
        if (onlytgt && !onlytgt->GetFilesList().Find(f))
 
1312
        {
1292
1313
            continue;
1293
 
 
 
1314
        }
1294
1315
        FileType ft = FileTypeOf(f->relativeFilename);
1295
1316
 
1296
1317
        TiXmlElement* unitnode = AddElement(prjnode, "Unit", "filename", f->relativeFilename);
1388
1409
 
1389
1410
    if (!compiler)
1390
1411
    {
1391
 
        if(!(Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/ignore_invalid_targets"), false)))
 
1412
        if(!(Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/ignore_invalid_targets"), true)))
1392
1413
        {
1393
1414
            wxString msg;
1394
1415
            msg.Printf(_("The defined compiler for %s cannot be located (ID: %s).\n"