1
//////////////////////////////////////////////////////////////////////////////
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : compiler.h
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
//////////////////////////////////////////////////////////////////////////////
24
//////////////////////////////////////////////////////////////////////////////
28
#include "configuration_object.h"
29
#include "smart_ptr.h"
32
#ifdef WXMAKINGDLL_LE_SDK
33
# define WXDLLIMPEXP_LE_SDK WXEXPORT
34
#elif defined(WXUSINGDLL_LE_SDK)
35
# define WXDLLIMPEXP_LE_SDK WXIMPORT
36
#else /* not making nor using FNB as DLL */
37
# define WXDLLIMPEXP_LE_SDK
38
#endif // WXMAKINGDLL_LE_SDK
42
* This class represenets a compiler entry in the configuration file
51
class WXDLLIMPEXP_LE_SDK Compiler : public ConfObject
59
struct CmpFileTypeInfo {
61
wxString compilation_line;
66
void AddCmpFileType(const wxString &extension, CmpFileKind type, const wxString &compile_line);
70
std::map<wxString, wxString> m_switches;
71
std::map<wxString, Compiler::CmpFileTypeInfo> m_fileTypes;
72
wxString m_objectSuffix;
73
wxString m_dependSuffix;
74
wxString m_preprocessSuffix;
76
wxString m_errorPattern;
77
wxString m_errorLineNubmerIndex;
78
wxString m_errorFileNameIndex;
80
wxString m_warningPattern;
81
wxString m_warningLineNubmerIndex;
82
wxString m_warningFileNameIndex;
84
std::map<wxString, wxString> m_tools;
85
wxString m_globalIncludePath;
86
wxString m_globalLibPath;
87
wxString m_pathVariable;
88
bool m_generateDependeciesFile;
91
typedef std::map<wxString, wxString>::const_iterator ConstIterator;
93
Compiler(wxXmlNode *node);
96
wxXmlNode *ToXml() const;
98
//iteration over switches
99
Compiler::ConstIterator SwitchesBegin() const {
100
return m_switches.begin();
102
Compiler::ConstIterator SwitchesEnd() const {
103
return m_switches.end();
106
//---------------------------------------------------
108
//---------------------------------------------------
109
wxString GetTool(const wxString &name) const;
110
void SetTool(const wxString &name, const wxString &tool) {
111
m_tools[name] = tool;
114
wxString GetSwitch(const wxString &name) const;
115
void SetSwitch(const wxString &name, const wxString &value) {
116
m_switches[name] = value;
118
const wxString &GetObjectSuffix() const {
119
return m_objectSuffix;
121
void SetObjectSuffix(const wxString &suffix) {
122
m_objectSuffix = suffix;
124
const wxString &GetDependSuffix() const {
125
return m_dependSuffix;
127
void SetDependSuffix(const wxString &suffix) {
128
m_dependSuffix = suffix;
130
const wxString &GetPreprocessSuffix() const {
131
return m_preprocessSuffix;
133
void SetPreprocessSuffix(const wxString &suffix) {
134
m_preprocessSuffix = suffix;
137
void SetName(const wxString &name) {
140
const wxString &GetName() const {
143
const wxString &GetErrPattern() const {
144
return m_errorPattern;
146
const wxString &GetErrFileNameIndex() const {
147
return m_errorFileNameIndex;
149
const wxString &GetErrLineNumberIndex() const {
150
return m_errorLineNubmerIndex;
152
const wxString &GetWarnPattern() const {
153
return m_warningPattern;
155
const wxString &GetWarnFileNameIndex() const {
156
return m_warningFileNameIndex;
158
const wxString &GetWarnLineNumberIndex() const {
159
return m_warningLineNubmerIndex;
1
//////////////////////////////////////////////////////////////////////////////
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : compiler.h
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
//////////////////////////////////////////////////////////////////////////////
24
//////////////////////////////////////////////////////////////////////////////
28
#include "configuration_object.h"
29
#include "smart_ptr.h"
32
#ifdef WXMAKINGDLL_LE_SDK
33
# define WXDLLIMPEXP_LE_SDK WXEXPORT
34
#elif defined(WXUSINGDLL_LE_SDK)
35
# define WXDLLIMPEXP_LE_SDK WXIMPORT
36
#else /* not making nor using FNB as DLL */
37
# define WXDLLIMPEXP_LE_SDK
38
#endif // WXMAKINGDLL_LE_SDK
42
* This class represenets a compiler entry in the configuration file
51
class WXDLLIMPEXP_LE_SDK Compiler : public ConfObject
59
struct CmpFileTypeInfo {
61
wxString compilation_line;
65
struct CmpCmdLineOption {
69
typedef std::map<wxString, CmpCmdLineOption> CmpCmdLineOptions;
72
void AddCmpFileType(const wxString &extension, CmpFileKind type, const wxString &compile_line);
76
std::map<wxString, wxString> m_switches;
77
std::map<wxString, Compiler::CmpFileTypeInfo> m_fileTypes;
78
CmpCmdLineOptions m_compilerOptions;
79
CmpCmdLineOptions m_linkerOptions;
80
wxString m_objectSuffix;
81
wxString m_dependSuffix;
82
wxString m_preprocessSuffix;
84
wxString m_errorPattern;
85
wxString m_errorLineNubmerIndex;
86
wxString m_errorFileNameIndex;
88
wxString m_warningPattern;
89
wxString m_warningLineNubmerIndex;
90
wxString m_warningFileNameIndex;
92
std::map<wxString, wxString> m_tools;
93
wxString m_globalIncludePath;
94
wxString m_globalLibPath;
95
wxString m_pathVariable;
96
bool m_generateDependeciesFile;
99
typedef std::map<wxString, wxString>::const_iterator ConstIterator;
101
Compiler(wxXmlNode *node);
104
wxXmlNode *ToXml() const;
106
//iteration over switches
107
Compiler::ConstIterator SwitchesBegin() const {
108
return m_switches.begin();
110
Compiler::ConstIterator SwitchesEnd() const {
111
return m_switches.end();
114
//---------------------------------------------------
116
//---------------------------------------------------
117
wxString GetTool(const wxString &name) const;
118
void SetTool(const wxString &name, const wxString &tool) {
119
m_tools[name] = tool;
122
wxString GetSwitch(const wxString &name) const;
123
void SetSwitch(const wxString &name, const wxString &value) {
124
m_switches[name] = value;
126
const wxString &GetObjectSuffix() const {
127
return m_objectSuffix;
129
void SetObjectSuffix(const wxString &suffix) {
130
m_objectSuffix = suffix;
132
const wxString &GetDependSuffix() const {
133
return m_dependSuffix;
135
void SetDependSuffix(const wxString &suffix) {
136
m_dependSuffix = suffix;
138
const wxString &GetPreprocessSuffix() const {
139
return m_preprocessSuffix;
141
void SetPreprocessSuffix(const wxString &suffix) {
142
m_preprocessSuffix = suffix;
145
void SetName(const wxString &name) {
148
const wxString &GetName() const {
151
const wxString &GetErrPattern() const {
152
return m_errorPattern;
154
const wxString &GetErrFileNameIndex() const {
155
return m_errorFileNameIndex;
157
const wxString &GetErrLineNumberIndex() const {
158
return m_errorLineNubmerIndex;
160
const wxString &GetWarnPattern() const {
161
return m_warningPattern;
163
const wxString &GetWarnFileNameIndex() const {
164
return m_warningFileNameIndex;
166
const wxString &GetWarnLineNumberIndex() const {
167
return m_warningLineNubmerIndex;
162
170
void SetErrPattern(const wxString &s) {