Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/src/OrxonoxConfig.h.in @ 2639

Last change on this file since 2639 was 2639, checked in by rgrieder, 15 years ago

Cleanup in OrxonoxConfig.h.in. Made use of various CMake features like CheckInclude or CheckCompiles to determine some options and macros in the config header file.

Also removed util/Integers.h and placed the code directory in OrxonoxConfig.h.in.

  • Property svn:eol-style set to native
File size: 4.7 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
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:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 *   Original code: OgrePlatform.h, licensed under the LGPL. The code
28 *   has changed almost completely though.
29 *
30 */
31
32/**
33 @file
34 @brief
35    Various constants for compiler, architecture and platform.
36
37    @GENERATED_FILE_COMMENT@
38 */
39
40#ifndef _OrxonoxConfig_H__
41#define _OrxonoxConfig_H__
42
43/*---------------------------------
44 * Platform and compiler related options
45 *-------------------------------*/
46#cmakedefine ORXONOX_PLATFORM_WINDOWS
47#cmakedefine ORXONOX_PLATFORM_LINUX
48#cmakedefine ORXONOX_PLATFORM_APPLE
49#cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */
50
51/* Determine compiler and set ORXONOX_COMP_VER */
52#if defined( _MSC_VER )
53#  define ORXONOX_COMPILER_MSVC
54#  define ORXONOX_COMP_VER _MSC_VER
55
56#elif defined( __GNUC__ )
57#  define ORXONOX_COMPILER_GCC
58#  define ORXONOX_COMP_VER (((__GNUC__)*100) + \
59        (__GNUC_MINOR__*10) + \
60        __GNUC_PATCHLEVEL__)
61#  if defined(__MINGW32__)
62#    define ORXONOX_COMPILER_MINGW
63#  endif
64
65#elif defined( __BORLANDC__ )
66#  define ORXONOX_COMPILER_BORLAND
67#  define ORXONOX_COMP_VER __BCPLUSPLUS__
68
69#else
70#  pragma error "No known compiler. Abort!"
71
72#endif
73
74/* Endianness */
75#cmakedefine ORXONOX_BIG_ENDIAN
76#cmakedefine ORXONOX_LITTLE_ENDIAN
77
78/* Architecture */
79#cmakedefine ORXONOX_ARCH_32
80#cmakedefine ORXONOX_ARCH_64
81
82/* See if we can use __forceinline or if we need to use __inline instead */
83#cmakedefine HAVE_FORCEINLINE
84#ifdef HAVE_FORCEINLINE
85#  define FORCEINLINE __forceinline
86#else
87#  define FORCEINLINE __inline
88#endif
89
90/* Try to define function information */
91#ifndef __FUNCTIONNAME__
92#  ifdef ORXONOX_COMPILER_BORLAND
93#    define __FUNCTIONNAME__ __FUNC__
94#  elif defined(ORXONOX_COMPILER_GCC)
95#    define __FUNCTIONNAME__ __PRETTY_FUNCTION__
96#  elif defined(ORXONOX_COMPILER_MSVC)
97#    define __FUNCTIONNAME__ __FUNCTION__
98#  else
99#    define __FUNCTIONNAME__
100#  endif
101#endif
102
103
104/*---------------------------------
105 * Version information
106 *-------------------------------*/
107#define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@
108#define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@
109#define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@
110#define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@"
111
112#define ORXONOX_VERSION ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH)
113
114
115/*---------------------------------
116 * Unix settings
117 *-------------------------------*/
118#ifdef ORXONOX_PLATFORM_UNIX
119
120/* TODO: Check what this actually is and whether we need it or not */
121#if 0
122#  ifdef ORXONOX_PLATFORM_APPLE
123#    define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle"
124#  else
125/* ORXONOX_PLATFORM_LINUX */
126#    define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so"
127#  endif
128#endif
129
130#endif /* Patform Unix */
131
132
133/*---------------------------------
134 * Apple Settings
135 *-------------------------------*/
136
137
138/*---------------------------------
139 * Includes
140 *-------------------------------*/
141/* Set whether we must suffix "ceguilua/" for the CEGUILua.h include */
142#cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY
143
144/* Define the english written operators like and, or, xor
145 * This is C++ standard, but the Microsoft compiler doesn't define them. */
146#cmakedefine HAVE_CISO646
147#ifdef HAVE_CISO646
148#  include <ciso646>
149#endif
150
151#cmakedefine HAVE_CSTDINT
152#ifdef HAVE_CSTDINT
153#  include <cstdint>
154#elif defined(ORXONOX_COMPILER_MSVC)
155typedef __int8            int8_t;
156typedef __int16           int16_t;
157typedef __int32           int32_t;
158typedef __int64           int64_t;
159typedef unsigned __int8   uint8_t;
160typedef unsigned __int16  uint16_t;
161typedef unsigned __int32  uint32_t;
162typedef unsigned __int64  uint64_t;
163#endif
164
165#cmakedefine HAVE_CSTDDEF
166#ifdef HAVE_CSTDDEF
167#  include <cstddef>
168#endif
169
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
175
176#endif /* _OrxonoxConfig_H__ */
Note: See TracBrowser for help on using the repository browser.