aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvilib/config/KviBuildInfo.cpp
blob: 5f22f4dd94bd9cbab860f3270f0c7a8fd8969433 (about) (plain) (blame)
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
//=============================================================================
//
//   File : KviBuildInfo.cpp
//   Creation date : Sat 19 Apr 2008 17:01:57 by Szymon Stefanek
//
//   This file is part of the KVIrc IRC Client distribution
//   Copyright (C) 2008 Szymon Stefanek <s.stefanek at libero dot it>
//   Copyright (C) 2008 Elvio Basello <hellvis69 at netsons dot org>
//
//   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.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//=============================================================================

#include "KviBuildInfo.h"
#include "kvi_sourcesdate.h"
#include "kvi_sysbuildinfo.h"

#include <QString>
#include <QStringList>

const QStringList feature_list{
	"IRC",
#ifdef COMPILE_DEBUG_MODE
	"Debug",
#endif
#ifdef COMPILE_IPV6_SUPPORT
	"IPv6",
#endif
#ifdef COMPILE_CRYPT_SUPPORT
	"Crypt",
#endif
#ifdef COMPILE_SSL_SUPPORT
	"SSL",
#endif
#ifdef COMPILE_GET_INTERFACE_ADDRESS
	"IfAddr",
#endif
#ifndef COMPILE_NO_IPC
	"IPC",
#endif
#ifdef COMPILE_KDE_SUPPORT
	"KDE",
#endif
#ifdef COMPILE_OSS_SUPPORT
	"OSS",
#endif
#ifdef COMPILE_AUDIOFILE_SUPPORT
	"Audiofile",
#endif
#ifdef COMPILE_PSEUDO_TRANSPARENCY
	"Transparency",
#endif
#ifdef COMPILE_PHONON_SUPPORT
	"Phonon",
#endif
#ifdef COMPILE_WEBENGINE_SUPPORT
	"WebEngine",
#endif
#ifndef COMPILE_DISABLE_DCC_VIDEO
	"DCCVideo",
#endif
#ifndef COMPILE_DISABLE_DCC_VOICE
	"DCCVoice",
#endif
#ifdef COMPILE_DCC_CANVAS
	"DCCCanvas",
#endif
#ifdef COMPILE_PERL_SUPPORT
	"Perl",
#endif
#ifdef COMPILE_PYTHON_SUPPORT
	"Python",
#endif
#ifdef COMPILE_ENCHANT_SUPPORT
	"Enchant",
#endif
#ifdef COMPILE_WINSPELLCHECKER_SUPPORT
	"Winspell",
#endif
	// This is not in "else" branch of below because some scripts may need it,
	// eg. /echo $features(Qt5) to determine if some features only available when Qt5 are present
	"Qt5",
#if(QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
	"Qt6",
#endif
	"KVS"
};

namespace KviBuildInfo
{
	QString buildDate()
	{
		return QString(KVIRC_BUILD_DATE);
	}

	QString buildSourcesDate()
	{
		return QString(KVI_SOURCES_DATE);
	}

	QString buildCommand()
	{
		return QString(KVIRC_BUILD_COMMAND);
	}

	QString buildFlags()
	{
		return QString(KVIRC_BUILD_FLAGS);
	}

	QString buildSystemName()
	{
#ifdef COMPILE_ON_WINDOWS
		return QString();
#else
		return QString(KVIRC_BUILD_SYSTEM_NAME);
#endif
	}

	QString buildCPU()
	{
		return QString(KVIRC_BUILD_CPU);
	}

	QString buildCompiler()
	{
		return QString(KVIRC_BUILD_COMPILER);
	}

	QString buildCompilerFlags()
	{
		QString flags = QString(KVIRC_BUILD_COMPILER_FLAGS);
		if(flags.isEmpty())
			return QString("N/A");
		else
			return flags;
	}

	const char * buildType()
	{
#ifdef COMPILE_DEBUG_MODE
		return "debug";
#else
		return "release";
#endif
	}

	QString buildRevision()
	{
#ifdef KVIRC_BUILD_REVISION
		return QString(KVIRC_BUILD_REVISION);
#else
		return QString();
#endif
	}

	QString qtVersion()
	{
		return QString(QT_VERSION_STR);
	}

	QString features()
	{
		return feature_list.join(", ");
	}
}