1 //============================================================================= 2 // 3 // File : KviBuildInfo.cpp 4 // Creation date : Sat 19 Apr 2008 17:01:57 by Szymon Stefanek 5 // 6 // This file is part of the KVIrc IRC Client distribution 7 // Copyright (C) 2008 Szymon Stefanek <s.stefanek at libero dot it> 8 // Copyright (C) 2008 Elvio Basello <hellvis69 at netsons dot org> 9 // 10 // This program is FREE software. You can redistribute it and/or 11 // modify it under the terms of the GNU General Public License 12 // as published by the Free Software Foundation; either version 2 13 // of the License, or (at your option) any later version. 14 // 15 // This program is distributed in the HOPE that it will be USEFUL, 16 // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 // See the GNU General Public License for more details. 19 // 20 // You should have received a copy of the GNU General Public License 21 // along with this program. If not, write to the Free Software Foundation, 22 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 23 // 24 //============================================================================= 25 26 #include "KviBuildInfo.h" 27 #include "kvi_sourcesdate.h" 28 #include "kvi_sysbuildinfo.h" 29 30 #include <QString> 31 #include <QStringList> 32 33 const QStringList feature_list{ 34 "IRC", 35 #ifdef COMPILE_DEBUG_MODE 36 "Debug", 37 #endif 38 #ifdef COMPILE_IPV6_SUPPORT 39 "IPv6", 40 #endif 41 #ifdef COMPILE_CRYPT_SUPPORT 42 "Crypt", 43 #endif 44 #ifdef COMPILE_SSL_SUPPORT 45 "SSL", 46 #endif 47 #ifdef COMPILE_GET_INTERFACE_ADDRESS 48 "IfAddr", 49 #endif 50 #ifndef COMPILE_NO_IPC 51 "IPC", 52 #endif 53 #ifdef COMPILE_KDE_SUPPORT 54 "KDE", 55 #endif 56 #ifdef COMPILE_OSS_SUPPORT 57 "OSS", 58 #endif 59 #ifdef COMPILE_ESD_SUPPORT 60 "ESD", 61 #endif 62 #ifdef COMPILE_AUDIOFILE_SUPPORT 63 "Audiofile", 64 #endif 65 #ifdef COMPILE_PSEUDO_TRANSPARENCY 66 "Transparency", 67 #endif 68 #ifdef COMPILE_PHONON_SUPPORT 69 "Phonon", 70 #endif 71 #ifdef COMPILE_WEBKIT_SUPPORT 72 "Webkit", 73 #endif 74 #ifndef COMPILE_DISABLE_DCC_VIDEO 75 "DCCVideo", 76 #endif 77 #ifndef COMPILE_DISABLE_DCC_VOICE 78 "DCCVoice", 79 #endif 80 #ifdef COMPILE_DCC_CANVAS 81 "DCCCanvas", 82 #endif 83 #ifdef COMPILE_PERL_SUPPORT 84 "Perl", 85 #endif 86 #ifdef COMPILE_PYTHON_SUPPORT 87 "Python", 88 #endif 89 #ifdef COMPILE_ENCHANT_SUPPORT 90 "Enchant", 91 #endif 92 #ifdef COMPILE_ENABLE_GTKSTYLE 93 "GTK", 94 #endif 95 "Qt5", 96 "KVS" 97 }; 98 99 namespace KviBuildInfo 100 { buildDate()101 QString buildDate() 102 { 103 return QString(KVIRC_BUILD_DATE); 104 } 105 buildSourcesDate()106 QString buildSourcesDate() 107 { 108 return QString(KVI_SOURCES_DATE); 109 } 110 buildCommand()111 QString buildCommand() 112 { 113 return QString(KVIRC_BUILD_COMMAND); 114 } 115 buildFlags()116 QString buildFlags() 117 { 118 return QString(KVIRC_BUILD_FLAGS); 119 } 120 buildSystemName()121 QString buildSystemName() 122 { 123 #ifdef COMPILE_ON_WINDOWS 124 return QString(); 125 #else 126 return QString(KVIRC_BUILD_SYSTEM_NAME); 127 #endif 128 } 129 buildCPU()130 QString buildCPU() 131 { 132 return QString(KVIRC_BUILD_CPU); 133 } 134 buildCompiler()135 QString buildCompiler() 136 { 137 return QString(KVIRC_BUILD_COMPILER); 138 } 139 buildCompilerFlags()140 QString buildCompilerFlags() 141 { 142 QString flags = QString(KVIRC_BUILD_COMPILER_FLAGS); 143 if(flags.isEmpty()) 144 return QString("N/A"); 145 else 146 return flags; 147 } 148 buildType()149 const char * buildType() 150 { 151 #ifdef COMPILE_DEBUG_MODE 152 return "debug"; 153 #else 154 return "release"; 155 #endif 156 } 157 buildRevision()158 QString buildRevision() 159 { 160 #ifdef KVIRC_BUILD_REVISION 161 return QString(KVIRC_BUILD_REVISION); 162 #else 163 return QString(); 164 #endif 165 } 166 qtVersion()167 QString qtVersion() 168 { 169 return QString(QT_VERSION_STR); 170 } 171 features()172 QString features() 173 { 174 return feature_list.join(", "); 175 } 176 } 177