-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompileconfig.h
89 lines (77 loc) · 1.45 KB
/
compileconfig.h
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
#ifndef COMPILECONFIG_H
#define COMPILECONFIG_H
#include <QDialog>
#include <QMap>
#include <QProcess>
#include <QJsonObject>
#include "config.h"
#include "language.h"
namespace Ui {
class CompileConfig;
}
struct CompileConfigure : public Config {
enum Optimize {
O_NONE,
O_LOW,
O_MED,
O_HIGH,
O_HIGHEST,
O_DEBUG
};
enum CStd {
CS_C90,
CS_C99,
CS_C11
};
enum CxxStd {
CXS_CXX98,
CXS_CXX11,
CXS_CXX14,
CXS_CXX17
};
enum Bit {
B_32,
B_64
};
enum Warning {
W_IGNORE,
W_NORMAL,
W_ALL,
W_EXTRA
};
QString name = "新配置";
QString gccPath = "";
QString gxxPath = "";
QString gdbPath = "";
QString extraCompile = "";
QString extraLink = "";
int optimize = O_NONE;
int cstd = CS_C90;
int cxxstd = CXS_CXX98;
int bit = B_32;
int warning = W_NORMAL;
bool werror = false;
bool debug = false;
virtual QJsonValue toJson() const;
virtual void fromJson(QJsonValue value);
QString start(QProcess& proc, const QString& src, Language* language);
};
extern CompileConfigure* currentConfig;
class CompileConfig : public QDialog {
Q_OBJECT
public:
explicit CompileConfig(QList<CompileConfigure> cfg, int cur, QWidget *parent = 0);
~CompileConfig();
const QList<CompileConfigure>& configure() const {
return config;
}
int currentConfigure() const {
return current;
}
private:
Ui::CompileConfig *ui;
QList<CompileConfigure> config;
int current;
CompileConfigure* currentConfig = nullptr;
};
#endif // COMPILECONFIG_H