Menu

[r7]: / Plugin / build_config.h  Maximize  Restore  History

Download this file

418 lines (374 with data), 11.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2008 by Eran Ifrah
// file name : build_config.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifndef BUILD_CONFIGURATION_H
#define BUILD_CONFIGURATION_H
#include "configuration_object.h"
#include "build_config_common.h"
#include <wx/arrstr.h>
#include <wx/string.h>
#include <list>
#include <map>
#ifndef WXDLLIMPEXP_LE_SDK
#ifdef WXMAKINGDLL_LE_SDK
# define WXDLLIMPEXP_LE_SDK WXEXPORT
#elif defined(WXUSINGDLL_LE_SDK)
# define WXDLLIMPEXP_LE_SDK WXIMPORT
#else /* not making nor using FNB as DLL */
# define WXDLLIMPEXP_LE_SDK
#endif // WXMAKINGDLL_LE_SDK
#endif
class WXDLLIMPEXP_LE_SDK BuildCommand
{
wxString m_command;
bool m_enabled;
public:
BuildCommand()
: m_command(wxEmptyString)
, m_enabled(false) {
}
BuildCommand(const wxString &command, bool enabled)
: m_command(command)
, m_enabled(enabled) {}
~BuildCommand() {}
const wxString &GetCommand() const {
return m_command;
}
bool GetEnabled() const {
return m_enabled;
}
void SetCommand(const wxString &command) {
m_command = command;
}
void SetEnabled(bool enabled) {
m_enabled = enabled;
}
};
typedef std::list<BuildCommand> BuildCommandList;
class WXDLLIMPEXP_LE_SDK BuildConfig : public ConfObject
{
public:
static const wxString OVERWRITE_GLOBAL_SETTINGS;
static const wxString APPEND_TO_GLOBAL_SETTINGS;
static const wxString PREPEND_GLOBAL_SETTINGS;
private:
BuildConfigCommon m_commonConfig;
wxString m_name;
BuildCommandList m_preBuildCommands;
BuildCommandList m_postBuildCommands;
bool m_compilerRequired;
bool m_linkerRequired;
bool m_enableCustomBuild;
wxString m_outputFile;
wxString m_intermediateDirectory;
wxString m_command;
wxString m_commandArguments;
wxString m_workingDirectory;
wxString m_compilerType;
wxString m_projectType;
wxString m_customBuildCmd;
wxString m_customCleanCmd;
bool m_isResCmpNeeded;
wxString m_debuggerType;
wxString m_customPostBuildRule;
wxString m_customPreBuildRule;
wxString m_customBuildWorkingDir;
bool m_pauseWhenExecEnds;
wxString m_toolName;
wxString m_makeGenerationCommand;
wxString m_singleFileBuildCommand;
wxString m_preprocessFileCommand;
wxString m_debuggerStartupCmds;
wxString m_debuggerPostRemoteConnectCmds;
bool m_isDbgRemoteTarget;
wxString m_dbgHostName;
wxString m_dbgHostPort;
std::map<wxString, wxString> m_customTargets;
wxString m_debuggerPath;
wxString m_buildCmpWithGlobalSettings;
wxString m_buildLnkWithGlobalSettings;
wxString m_buildResWithGlobalSettings;
public:
BuildConfig(wxXmlNode *node);
virtual ~BuildConfig();
wxXmlNode *ToXml() const;
BuildConfig *Clone() const;
//--------------------------------
// Setters / Getters
//--------------------------------
wxString GetPreprocessor() const;
void GetPreprocessor(wxArrayString &arr) {
m_commonConfig.GetPreprocessor(arr);
}
void SetPreprocessor(const wxString &prepr);
const wxString &GetCompilerType() const {
return m_compilerType;
}
void SetCompilerType(const wxString &cmpType) {
m_compilerType = cmpType;
}
const wxString &GetDebuggerType() const {
return m_debuggerType;
}
void SetDebuggerType(const wxString &type) {
m_debuggerType = type;
}
wxString GetIncludePath() const;
const wxString &GetCompileOptions() const {
return m_commonConfig.GetCompileOptions();
}
const wxString &GetLinkOptions() const {
return m_commonConfig.GetLinkOptions();
}
wxString GetLibraries() const;
wxString GetLibPath() const;
void GetPreBuildCommands(BuildCommandList &cmds) {
cmds = m_preBuildCommands;
}
void GetPostBuildCommands(BuildCommandList &cmds) {
cmds = m_postBuildCommands;
}
const wxString &GetName() const {
return m_name;
}
bool IsCompilerRequired() const {
return m_compilerRequired;
}
bool IsLinkerRequired() const {
return m_linkerRequired;
}
wxString GetOutputFileName() const;
wxString GetIntermediateDirectory() const;
const wxString &GetCommand() const {
return m_command;
}
const wxString &GetCommandArguments() const {
return m_commandArguments;
}
wxString GetWorkingDirectory() const;
bool IsCustomBuild() const {
return m_enableCustomBuild;
}
const wxString &GetCustomBuildCmd()const {
return m_customBuildCmd;
}
const wxString &GetCustomCleanCmd()const {
return m_customCleanCmd;
}
void SetIncludePath(const wxArrayString &paths) {
m_commonConfig.SetIncludePath(paths);
}
void SetIncludePath(const wxString &path);
void SetLibraries(const wxString &libs);
void SetLibPath(const wxString &path);
void SetCompileOptions(const wxString &options) {
m_commonConfig.SetCompileOptions(options);
}
void SetLinkOptions(const wxString &options) {
m_commonConfig.SetLinkOptions(options);
}
void SetPreBuildCommands(const BuildCommandList &cmds) {
m_preBuildCommands = cmds;
}
void SetPostBuildCommands(const BuildCommandList &cmds) {
m_postBuildCommands = cmds;
}
void SetLibraries(const wxArrayString &libs) {
m_commonConfig.SetLibraries(libs);
}
void SetLibPath(const wxArrayString &libPaths) {
m_commonConfig.SetLibPath(libPaths);
}
void SetName(const wxString &name) {
m_name = name;
}
void SetCompilerRequired(bool required) {
m_compilerRequired = required;
}
void SetLinkerRequired(bool required) {
m_linkerRequired = required;
}
void SetOutputFileName(const wxString &name) {
m_outputFile = name;
}
void SetIntermediateDirectory(const wxString &dir) {
m_intermediateDirectory = dir;
}
void SetCommand(const wxString &cmd) {
m_command = cmd;
}
void SetCommandArguments(const wxString &cmdArgs) {
m_commandArguments = cmdArgs;
}
void SetWorkingDirectory(const wxString &dir) {
m_workingDirectory = dir;
}
void SetCustomBuildCmd(const wxString &cmd) {
m_customBuildCmd = cmd;
}
void SetCustomCleanCmd(const wxString &cmd) {
m_customCleanCmd = cmd;
}
void EnableCustomBuild(bool enable) {
m_enableCustomBuild = enable;
}
void SetResCompilerRequired(bool required) {
m_isResCmpNeeded = required;
}
bool IsResCompilerRequired() const {
return m_isResCmpNeeded;
}
void SetResCmpIncludePath(const wxString &path) {
m_commonConfig.SetResCmpIncludePath(path);
}
const wxString& GetResCmpIncludePath() const {
return m_commonConfig.GetResCmpIncludePath();
}
void SetResCmpOptions(const wxString &options) {
m_commonConfig.SetResCmpOptions(options);
}
const wxString &GetResCompileOptions() const {
return m_commonConfig.GetResCompileOptions();
}
//special custom rules
wxString GetPreBuildCustom() const {
return m_customPreBuildRule;
}
wxString GetPostBuildCustom() const {
return m_customPostBuildRule;
}
void SetPreBuildCustom(const wxString& rule) {
m_customPreBuildRule = rule;
}
void SetPostBuildCustom(const wxString& rule) {
m_customPostBuildRule = rule;
}
void SetCustomBuildWorkingDir(const wxString& customBuildWorkingDir) {
this->m_customBuildWorkingDir = customBuildWorkingDir;
}
const wxString& GetCustomBuildWorkingDir() const {
return m_customBuildWorkingDir;
}
void SetPauseWhenExecEnds(const bool& pauseWhenExecEnds) {
this->m_pauseWhenExecEnds = pauseWhenExecEnds;
}
const bool& GetPauseWhenExecEnds() const {
return m_pauseWhenExecEnds;
}
void SetMakeGenerationCommand(const wxString& makeGenerationCommand) {
this->m_makeGenerationCommand = makeGenerationCommand;
}
void SetToolName(const wxString& toolName) {
this->m_toolName = toolName;
}
const wxString& GetMakeGenerationCommand() const {
return m_makeGenerationCommand;
}
const wxString& GetToolName() const {
return m_toolName;
}
void SetSingleFileBuildCommand(const wxString& singleFileBuildCommand) {
this->m_singleFileBuildCommand = singleFileBuildCommand;
}
const wxString& GetSingleFileBuildCommand() const {
return m_singleFileBuildCommand;
}
void SetPreprocessFileCommand(const wxString &preprocessFileCommand) {
this->m_preprocessFileCommand = preprocessFileCommand;
}
const wxString &GetPreprocessFileCommand() const {
return m_preprocessFileCommand;
}
const wxString &GetProjectType() const {
return m_projectType;
}
void SetProjectType(const wxString &projectType) {
m_projectType = projectType;
}
void SetDebuggerStartupCmds(const wxString& debuggerStartupCmds) {
this->m_debuggerStartupCmds = debuggerStartupCmds;
}
const wxString& GetDebuggerStartupCmds() const {
return m_debuggerStartupCmds;
}
void SetIsDbgRemoteTarget(const bool& isDbgRemoteTarget) {
this->m_isDbgRemoteTarget = isDbgRemoteTarget;
}
const bool& GetIsDbgRemoteTarget() const {
return m_isDbgRemoteTarget;
}
void SetDbgHostName(const wxString& dbgHostName) {
this->m_dbgHostName = dbgHostName;
}
void SetDbgHostPort(const wxString& dbgHostPort) {
this->m_dbgHostPort = dbgHostPort;
}
const wxString& GetDbgHostName() const {
return m_dbgHostName;
}
const wxString& GetDbgHostPort() const {
return m_dbgHostPort;
}
void SetCustomTargets(const std::map<wxString, wxString>& customTargets) {
this->m_customTargets = customTargets;
}
const std::map<wxString, wxString>& GetCustomTargets() const {
return m_customTargets;
}
void SetDebuggerPath(const wxString& debuggerPath) {
this->m_debuggerPath = debuggerPath;
}
const wxString& GetDebuggerPath() const {
return m_debuggerPath;
}
void SetDebuggerPostRemoteConnectCmds(const wxString& debuggerPostRemoteConnectCmds) {
this->m_debuggerPostRemoteConnectCmds = debuggerPostRemoteConnectCmds;
}
const wxString& GetDebuggerPostRemoteConnectCmds() const {
return m_debuggerPostRemoteConnectCmds;
}
const wxString& GetBuildCmpWithGlobalSettings() const {
return m_buildCmpWithGlobalSettings;
}
void SetBuildCmpWithGlobalSettings(const wxString &buildType) {
m_buildCmpWithGlobalSettings = buildType;
}
const wxString& GetBuildLnkWithGlobalSettings() const {
return m_buildLnkWithGlobalSettings;
}
void SetBuildLnkWithGlobalSettings(const wxString &buildType) {
m_buildLnkWithGlobalSettings = buildType;
}
const wxString& GetBuildResWithGlobalSettings() const {
return m_buildResWithGlobalSettings;
}
void SetBuildResWithGlobalSettings(const wxString &buildType) {
m_buildResWithGlobalSettings = buildType;
}
const BuildConfigCommon& GetCommonConfiguration() const {
return m_commonConfig;
}
};
typedef SmartPtr<BuildConfig> BuildConfigPtr;
#endif // BUILD_CONFIGURATION_H
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.