~ubuntu-branches/ubuntu/karmic/codelite/karmic

« back to all changes in this revision

Viewing changes to Plugin/compile_request.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-08-15 17:42:43 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090815174243-nlb9ikgigbiybz12
Tags: 1.0.2893+dfsg-0ubuntu1
* debian/rules:
  + Tidy up get-orig-source rule
* debian/control:
  + Bump Standards-Version
  + Change Maintainer email address to @ubuntu.com
  + Drop cdbs build-dependency
* debian/copyright:
  + Update to DEP-5 format
* debian/patches/00_add-fPIC.patch:
  + Dropped, fix upstream
* Closes LP: #413992

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
//
23
23
//////////////////////////////////////////////////////////////////////////////
24
24
//////////////////////////////////////////////////////////////////////////////
25
 
 #include "compile_request.h"
 
25
#include "compile_request.h"
26
26
#include "imanager.h"
27
27
#include "macros.h"
28
28
#include "compiler.h"
40
40
                : ShellCommand(owner, buildInfo)
41
41
                , m_fileName(fileName)
42
42
                , m_premakeOnly(runPremakeOnly)
43
 
        , m_preprocessOnly(preprocessOnly)
 
43
                , m_preprocessOnly(preprocessOnly)
44
44
{
45
45
}
46
46
 
69
69
                return;
70
70
        }
71
71
 
72
 
        // TODO:: make the builder name configurable
 
72
        // since this code can be called from inside the application OR
 
73
        // from inside a DLL, we use the application pointer from the manager
 
74
        // when available, otherwise, events will not be processed inside
 
75
        // plugins
 
76
        wxApp *app = manager ? manager->GetTheApp() : wxTheApp;
 
77
        wxString pname (proj->GetName());
 
78
 
73
79
        BuilderPtr builder = bm->GetBuilder(wxT("GNU makefile for g++/gcc"));
74
80
        if (m_fileName.IsEmpty() == false) {
75
81
                //we got a complie request of a single file
76
82
                cmd = m_preprocessOnly ? builder->GetPreprocessFileCmd(m_info.GetProject(), m_info.GetConfiguration(), m_fileName, errMsg)
77
 
                               : builder->GetSingleFileCmd(m_info.GetProject(), m_info.GetConfiguration(), m_fileName, errMsg);
 
83
                      : builder->GetSingleFileCmd(m_info.GetProject(), m_info.GetConfiguration(), m_fileName, errMsg);
78
84
        } else if (m_info.GetProjectOnly()) {
79
85
                cmd = builder->GetPOBuildCommand(m_info.GetProject(), m_info.GetConfiguration());
80
86
        } else {
83
89
 
84
90
        // Notify plugins that a compile process is going to start
85
91
        wxCommandEvent event(wxEVT_BUILD_STARTING);
86
 
        
87
 
        wxString pname (proj->GetName());
88
92
        event.SetClientData((void*)&pname);
89
 
        
90
 
        // since this code can be called from inside the application OR
91
 
        // from inside a DLL, we use the application pointer from the manager
92
 
        // when available, otherwise, events will not be processed inside
93
 
        // plugins
94
 
        wxApp *app = manager ? manager->GetTheApp() : wxTheApp;
95
 
        app->ProcessEvent(event);
 
93
        event.SetString( m_info.GetConfiguration() );
 
94
 
 
95
        if (app->ProcessEvent(event)) {
 
96
 
 
97
                // the build is being handled by some plugin, no need to build it
 
98
                // using the standard way
 
99
                SetBusy(false);
 
100
                return;
 
101
        }
96
102
 
97
103
        // Send the EVENT_STARTED : even if this event is sent, next event will
98
104
        // be post, so no way to be sure the the build process has not started
109
115
 
110
116
        }
111
117
 
112
 
        if(bldConf) {
 
118
        if (bldConf) {
113
119
                wxString cmpType = bldConf->GetCompilerType();
114
120
                CompilerPtr cmp = bsc->GetCompiler(cmpType);
115
 
                if(cmp) {
 
121
                if (cmp) {
116
122
                        wxString value( cmp->GetPathVariable() );
117
 
                        if(value.Trim().Trim(false).IsEmpty() == false) {
 
123
                        if (value.Trim().Trim(false).IsEmpty() == false) {
118
124
                                wxLogMessage(wxString::Format(wxT("Setting PATH to '%s'"), value.c_str()));
119
125
                                om[wxT("PATH")] = value.Trim().Trim(false);
120
126
                        }
153
159
 
154
160
                // print the prefix message of the build start. This is important since the parser relies
155
161
                // on this message
156
 
                if(m_info.GetProjectOnly() || m_fileName.IsEmpty() == false){
 
162
                if (m_info.GetProjectOnly() || m_fileName.IsEmpty() == false) {
157
163
                        wxString configName(m_info.GetConfiguration());
158
164
 
159
165
                        //also, send another message to the main frame, indicating which project is being built
164
170
                                text << wxT("----------\n");
165
171
                        } else if (m_preprocessOnly) {
166
172
                                text << wxT(" (Preprocess Single File)----------\n");
167
 
            } else {
 
173
                        } else {
168
174
                                text << wxT(" (Single File Build)----------\n");
169
175
                        }
170
176
                        AppendLine(text);