[682] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
[1505] | 3 | * > www.orxonox.net < |
---|
[682] | 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[2639] | 23 | * Reto Grieder |
---|
| 24 | * Co-authors: |
---|
[1293] | 25 | * ... |
---|
[682] | 26 | * |
---|
[1755] | 27 | * Original code: OgrePlatform.h, licensed under the LGPL. The code |
---|
[2639] | 28 | * has changed almost completely though. |
---|
[1755] | 29 | * |
---|
[2643] | 30 | * Caution: Do not configure this file CMake configuration (Debug, Release, etc.) |
---|
| 31 | * dependent! XCode and Visual Studio have the same file for all. |
---|
| 32 | * |
---|
[682] | 33 | */ |
---|
[1505] | 34 | |
---|
[682] | 35 | /** |
---|
[1032] | 36 | @file |
---|
[1755] | 37 | @brief |
---|
| 38 | Various constants for compiler, architecture and platform. |
---|
[2639] | 39 | |
---|
| 40 | @GENERATED_FILE_COMMENT@ |
---|
[682] | 41 | */ |
---|
[1505] | 42 | |
---|
[2639] | 43 | #ifndef _OrxonoxConfig_H__ |
---|
| 44 | #define _OrxonoxConfig_H__ |
---|
[1505] | 45 | |
---|
[2639] | 46 | /*--------------------------------- |
---|
| 47 | * Platform and compiler related options |
---|
| 48 | *-------------------------------*/ |
---|
| 49 | #cmakedefine ORXONOX_PLATFORM_WINDOWS |
---|
| 50 | #cmakedefine ORXONOX_PLATFORM_LINUX |
---|
| 51 | #cmakedefine ORXONOX_PLATFORM_APPLE |
---|
| 52 | #cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */ |
---|
[1755] | 53 | |
---|
[2639] | 54 | /* Determine compiler and set ORXONOX_COMP_VER */ |
---|
[1505] | 55 | #if defined( _MSC_VER ) |
---|
[2639] | 56 | # define ORXONOX_COMPILER_MSVC |
---|
[1505] | 57 | # define ORXONOX_COMP_VER _MSC_VER |
---|
| 58 | |
---|
| 59 | #elif defined( __GNUC__ ) |
---|
[2639] | 60 | # define ORXONOX_COMPILER_GCC |
---|
[1505] | 61 | # define ORXONOX_COMP_VER (((__GNUC__)*100) + \ |
---|
| 62 | (__GNUC_MINOR__*10) + \ |
---|
| 63 | __GNUC_PATCHLEVEL__) |
---|
[2639] | 64 | # if defined(__MINGW32__) |
---|
| 65 | # define ORXONOX_COMPILER_MINGW |
---|
| 66 | # endif |
---|
[1505] | 67 | |
---|
| 68 | #elif defined( __BORLANDC__ ) |
---|
[2639] | 69 | # define ORXONOX_COMPILER_BORLAND |
---|
[1505] | 70 | # define ORXONOX_COMP_VER __BCPLUSPLUS__ |
---|
| 71 | |
---|
| 72 | #else |
---|
[2639] | 73 | # pragma error "No known compiler. Abort!" |
---|
[1505] | 74 | |
---|
| 75 | #endif |
---|
| 76 | |
---|
[2639] | 77 | /* Endianness */ |
---|
| 78 | #cmakedefine ORXONOX_BIG_ENDIAN |
---|
| 79 | #cmakedefine ORXONOX_LITTLE_ENDIAN |
---|
[1755] | 80 | |
---|
[2639] | 81 | /* Architecture */ |
---|
| 82 | #cmakedefine ORXONOX_ARCH_32 |
---|
| 83 | #cmakedefine ORXONOX_ARCH_64 |
---|
| 84 | |
---|
[1505] | 85 | /* See if we can use __forceinline or if we need to use __inline instead */ |
---|
[2639] | 86 | #cmakedefine HAVE_FORCEINLINE |
---|
| 87 | #ifdef HAVE_FORCEINLINE |
---|
| 88 | # define FORCEINLINE __forceinline |
---|
[1505] | 89 | #else |
---|
| 90 | # define FORCEINLINE __inline |
---|
| 91 | #endif |
---|
| 92 | |
---|
[1755] | 93 | /* Try to define function information */ |
---|
| 94 | #ifndef __FUNCTIONNAME__ |
---|
[2639] | 95 | # ifdef ORXONOX_COMPILER_BORLAND |
---|
[1755] | 96 | # define __FUNCTIONNAME__ __FUNC__ |
---|
[2639] | 97 | # elif defined(ORXONOX_COMPILER_GCC) |
---|
[1755] | 98 | # define __FUNCTIONNAME__ __PRETTY_FUNCTION__ |
---|
[2639] | 99 | # elif defined(ORXONOX_COMPILER_MSVC) |
---|
[1755] | 100 | # define __FUNCTIONNAME__ __FUNCTION__ |
---|
[1505] | 101 | # else |
---|
[1755] | 102 | # define __FUNCTIONNAME__ |
---|
[1505] | 103 | # endif |
---|
[1755] | 104 | #endif |
---|
[1505] | 105 | |
---|
[1755] | 106 | |
---|
[2639] | 107 | /*--------------------------------- |
---|
| 108 | * Version information |
---|
| 109 | *-------------------------------*/ |
---|
| 110 | #define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@ |
---|
| 111 | #define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@ |
---|
| 112 | #define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@ |
---|
| 113 | #define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@" |
---|
[1755] | 114 | |
---|
[1921] | 115 | #define ORXONOX_VERSION ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH) |
---|
| 116 | |
---|
| 117 | |
---|
[1755] | 118 | /*--------------------------------- |
---|
[2639] | 119 | * Unix settings |
---|
[1755] | 120 | *-------------------------------*/ |
---|
[2639] | 121 | #ifdef ORXONOX_PLATFORM_UNIX |
---|
[1505] | 122 | |
---|
[1755] | 123 | /* TODO: Check what this actually is and whether we need it or not */ |
---|
| 124 | #if 0 |
---|
[2639] | 125 | # ifdef ORXONOX_PLATFORM_APPLE |
---|
[1505] | 126 | # define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle" |
---|
| 127 | # else |
---|
[1755] | 128 | /* ORXONOX_PLATFORM_LINUX */ |
---|
[1505] | 129 | # define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so" |
---|
| 130 | # endif |
---|
[1755] | 131 | #endif |
---|
[1505] | 132 | |
---|
[2639] | 133 | #endif /* Patform Unix */ |
---|
[1505] | 134 | |
---|
| 135 | |
---|
[1755] | 136 | /*--------------------------------- |
---|
| 137 | * Apple Settings |
---|
| 138 | *-------------------------------*/ |
---|
[1505] | 139 | |
---|
| 140 | |
---|
[1755] | 141 | /*--------------------------------- |
---|
[2639] | 142 | * Includes |
---|
[1755] | 143 | *-------------------------------*/ |
---|
[2639] | 144 | /* Define the english written operators like and, or, xor |
---|
| 145 | * This is C++ standard, but the Microsoft compiler doesn't define them. */ |
---|
[2650] | 146 | #cmakedefine HAVE_ISO646_H |
---|
| 147 | #ifdef HAVE_ISO646_H |
---|
| 148 | # include <iso646.h> |
---|
[2639] | 149 | #endif |
---|
[1505] | 150 | |
---|
[2650] | 151 | #cmakedefine HAVE_STDINT_H |
---|
| 152 | #ifdef HAVE_STDINT_H |
---|
| 153 | # include <stdint.h> |
---|
[2639] | 154 | #elif defined(ORXONOX_COMPILER_MSVC) |
---|
| 155 | typedef __int8 int8_t; |
---|
| 156 | typedef __int16 int16_t; |
---|
| 157 | typedef __int32 int32_t; |
---|
| 158 | typedef __int64 int64_t; |
---|
| 159 | typedef unsigned __int8 uint8_t; |
---|
| 160 | typedef unsigned __int16 uint16_t; |
---|
| 161 | typedef unsigned __int32 uint32_t; |
---|
| 162 | typedef unsigned __int64 uint64_t; |
---|
| 163 | #endif |
---|
[1505] | 164 | |
---|
[2650] | 165 | #cmakedefine HAVE_STDDEF_H |
---|
| 166 | #ifdef HAVE_STDDEF_H |
---|
| 167 | # include <stddef.h> |
---|
[2639] | 168 | #endif |
---|
[1505] | 169 | |
---|
[2639] | 170 | /* Visual Leak Detector looks for memory leaks */ |
---|
| 171 | #cmakedefine ACTIVATE_VISUAL_LEAK_DETECTOR |
---|
| 172 | #ifdef ACTIVATE_VISUAL_LEAK_DETECTOR |
---|
| 173 | # include <vld.h> |
---|
| 174 | #endif |
---|
[1505] | 175 | |
---|
[2643] | 176 | |
---|
| 177 | /*--------------------------------- |
---|
| 178 | * Various Settings |
---|
| 179 | *-------------------------------*/ |
---|
| 180 | /* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */ |
---|
| 181 | #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY |
---|
| 182 | |
---|
| 183 | /* Defined if a precompiled depdency package was used. We then copy all libraries |
---|
| 184 | too when installing. */ |
---|
| 185 | #cmakedefine USE_DEPENDENCY_PACKAGE |
---|
| 186 | |
---|
| 187 | /* Handle default ConfigValues */ |
---|
| 188 | namespace orxonox |
---|
| 189 | { |
---|
[2645] | 190 | #ifdef ORXONOX_PLATFORM_WINDOWS |
---|
| 191 | const char* const ORXONOX_MEDIA_PATH("../media"); |
---|
| 192 | #elif defined(ORXONOX_PLATFORM_LINUX) |
---|
[2659] | 193 | const char* const ORXONOX_MEDIA_PATH("../../share/orxonox"); |
---|
[2645] | 194 | #else |
---|
| 195 | /* TODO: Apple? */ |
---|
[2659] | 196 | const char* const ORXONOX_MEDIA_PATH("../../share/orxonox"); |
---|
[2645] | 197 | #endif |
---|
[2643] | 198 | |
---|
| 199 | #ifdef NDEBUG |
---|
| 200 | const char* const ORXONOX_OGRE_PLUGINS("@OGRE_PLUGINS_RELEASE@"); |
---|
| 201 | # ifdef USE_DEPENDENCY_PACKAGE |
---|
| 202 | const char* const ORXONOX_OGRE_PLUGINS_FOLDER("."); |
---|
[2650] | 203 | # else |
---|
[2643] | 204 | const char* const ORXONOX_OGRE_PLUGINS_FOLDER("@OGRE_PLUGINS_FOLDER_RELEASE@"); |
---|
| 205 | # endif |
---|
| 206 | #else |
---|
| 207 | const char* const ORXONOX_OGRE_PLUGINS("@OGRE_PLUGINS_DEBUG@"); |
---|
| 208 | # ifdef USE_DEPENDENCY_PACKAGE |
---|
| 209 | const char* const ORXONOX_OGRE_PLUGINS_FOLDER("."); |
---|
[2650] | 210 | # else |
---|
[2643] | 211 | const char* const ORXONOX_OGRE_PLUGINS_FOLDER("@OGRE_PLUGINS_FOLDER_DEBUG@"); |
---|
| 212 | # endif |
---|
| 213 | #endif |
---|
| 214 | } |
---|
| 215 | |
---|
| 216 | |
---|
[2639] | 217 | #endif /* _OrxonoxConfig_H__ */ |
---|