1 // compiler options, common for all game modules
2 {$MODE OBJFPC}
4 {$MODESWITCH ADVANCEDRECORDS+}
5 {$MODESWITCH ALLOWINLINE+}
6 {$MODESWITCH ANSISTRINGS+} // Allow use of ansistrings.
7 {$MODESWITCH AUTODEREF+} // Automatic (silent) dereferencing of typed pointers.
8 {$MODESWITCH CLASS+}
9 {$MODESWITCH CLASSICPROCVARS+} // Use classical procedural variables.
10 {$MODESWITCH DEFAULTPARAMETERS+} // Allow use of default parameter values.
11 {$MODESWITCH DUPLICATELOCALS-} // Allow local variables in class methods to have the same names as properties of the class.
12 {$MODESWITCH EXCEPTIONS+}
13 {$MODESWITCH HINTDIRECTIVE+} // Support the hint directives (deprecated, platform etc.)
14 {$MODESWITCH INITFINAL+} // Allow use of Initialization and Finalization
15 {.$MODESWITCH ISOUNARYMINUS-} // Unary minus as required by ISO pascal.
16 {$MODESWITCH MACPROCVARS-} // Use mac-style procedural variables.
17 {$MODESWITCH NESTEDCOMMENTS-}
18 {$MODESWITCH NESTEDPROCVARS+}
19 {$MODESWITCH OBJPAS+}
20 {$MODESWITCH OUT+} // Allow use of the out parameter type.
21 {$MODESWITCH PCHARTOSTRING+}
22 {$MODESWITCH POINTERTOPROCVAR+} // Allow silent conversion of pointers to procedural variables.
23 {$MODESWITCH PROPERTIES+}
24 {$MODESWITCH REPEATFORWARD+} // Implementation and Forward declaration must match completely.
25 {$MODESWITCH RESULT+}
26 {$MODESWITCH TYPEHELPERS+} // Allow the use of type helpers.
27 {$MODESWITCH UNICODESTRINGS-}
29 {$IFDEF DARWIN}
30 {$MODESWITCH OBJECTIVEC1}
31 {$ENDIF}
33 {$ASSERTIONS ON}
34 {$BITPACKING OFF}
35 {$BOOLEVAL OFF}
36 {$COPERATORS ON}
37 {$EXTENDEDSYNTAX ON}
38 {$IFDEF CPU386}
39 {$FPUTYPE SSE}
40 {$ENDIF}
41 {$GOTO ON}
42 {$IEEEERRORS OFF}
43 {$INLINE ON}
44 {$LONGSTRINGS ON}
45 {$MACRO OFF}
46 {$OBJECTCHECKS OFF}
47 {$OVERFLOWCHECKS OFF}
48 {$POINTERMATH ON}
49 {$RANGECHECKS OFF}
50 {$SAFEFPUEXCEPTIONS OFF}
51 {$SCOPEDENUMS ON} // this may be changed later
52 {$SMARTLINK ON}
53 {$TYPEDADDRESS ON}
54 {$TYPEINFO ON}
55 {$VARSTRINGCHECKS OFF}
57 {$S-} // disable stack checking
58 {$MMX-} // get lost, mmx
60 {$IF DEFINED(D2F_DEBUG)}
61 {$STACKFRAMES ON}
62 {$HINTS OFF}
63 {$ELSE}
64 {$STACKFRAMES OFF}
65 {$HINTS OFF}
66 {$DEFINE D2F_MORE_OPTIM}
67 {$ENDIF}
68 {$WARNINGS ON}
69 {$NOTES ON}
71 {$IF DEFINED(D2F_DEBUG_OPTIM) or DEFINED(D2F_MORE_OPTIM)}
72 {$OPTIMIZATION DEADVALUES}
73 {$OPTIMIZATION CONSTPROP}
74 {$OPTIMIZATION DEADSTORE}
75 {$ENDIF}
77 {$IFDEF WIN32}
78 {$IFNDEF MSWINDOWS}
79 {$DEFINE MSWINDOWS}
80 {$ENDIF}
81 {$ENDIF}
83 {$IFDEF MSWINDOWS}
84 {$IFNDEF WINDOWS}
85 {$DEFINE WINDOWS}
86 {$ENDIF WINDOWS}
87 {$ENDIF}
89 (* --------- Build options check --------- *)
91 {$IFDEF HEADLESS}
92 {$DEFINE USE_SYSSTUB}
93 {$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
94 {$WARNING System drivers not supported in headless mode. Force stub driver...}
95 {$UNDEF USE_SDL}
96 {$UNDEF USE_SDL2}
97 {$ENDIF}
98 {$DEFINE USE_GLSTUB}
99 {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
100 {$WARNING Render drivers not needed in headless mode. Force stub driver...}
101 {$UNDEF USE_GLES1}
102 {$UNDEF USE_OPENGL}
103 {$ENDIF}
104 {$IFDEF ENABLE_HOLMES}
105 {$WARNING Holmes in headless mode has no sense. Disabled.}
106 {$UNDEF ENABLE_HOLMES}
107 {$ENDIF}
108 {$IFDEF ENABLE_MENU}
109 {$WARNING Menu in headless mode has no sense. Disabled.}
110 {$UNDEF ENABLE_MENU}
111 {$DEFINE DISABLE_MENU}
112 {$ENDIF}
113 {$IFDEF ENABLE_TOUCH}
114 {$WARNING Touch screen in headless mode has no sense. Disabled.}
115 {$UNDEF ENABLE_TOUCH}
116 {$DEFINE DISABLE_TOUCH}
117 {$ENDIF}
118 {$IFDEF ENABLE_GFX}
119 {$WARNING GFX in headless mode has no sense. Disabled.}
120 {$UNDEF ENABLE_GFX}
121 {$DEFINE DISABLE_GFX}
122 {$ENDIF}
123 {$IFDEF ENABLE_GIBS}
124 {$WARNING Gibs in headless mode has no sense. Disabled.}
125 {$UNDEF ENABLE_GIBS}
126 {$DEFINE DISABLE_GIBS}
127 {$ENDIF}
128 {$IFDEF ENABLE_SHELLS}
129 {$WARNING Shells in headless mode has no sense. Disabled.}
130 {$UNDEF ENABLE_SHELLS}
131 {$DEFINE DISABLE_SHELLS}
132 {$ENDIF}
133 {$IFDEF ENABLE_CORPSES}
134 {$WARNING Corpses in headless mode has no sense. Disabled.}
135 {$UNDEF ENABLE_CORPSES}
136 {$DEFINE DISABLE_CORPSES}
137 {$ENDIF}
138 {$ENDIF}
140 {$IF DEFINED(ENABLE_MENU) AND DEFINED(DISABLE_MENU)}
141 {$ERROR Select ENABLE_MENU or DISABLE_MENU}
142 {$ELSEIF NOT DEFINED(ENABLE_MENU) AND NOT DEFINED(DISABLE_MENU)}
143 // defaut ENABLE/DISABLE menu
144 {$IFDEF HEADLESS}
145 {$DEFINE DISABLE_MENU}
146 {$ELSE}
147 {$DEFINE ENABLE_MENU}
148 {$ENDIF}
149 {$ENDIF}
151 {$IF DEFINED(ENABLE_TOUCH) AND DEFINED(DISABLE_TOUCH)}
152 {$ERROR Select ENABLE_TOUCH or DISABLE_TOUCH}
153 {$ELSEIF NOT DEFINED(ENABLE_TOUCH) AND NOT DEFINED(DISABLE_TOUCH)}
154 // defaut ENABLE/DISABLE touch
155 {$IFDEF HEADLESS}
156 {$DEFINE DISABLE_TOUCH}
157 {$ELSE}
158 {$DEFINE ENABLE_TOUCH}
159 {$ENDIF}
160 {$ENDIF}
162 {$IF DEFINED(ENABLE_GFX) AND DEFINED(DISABLE_GFX)}
163 {$ERROR Select ENABLE_GFX or DISABLE_GFX}
164 {$ELSEIF NOT DEFINED(ENABLE_GFX) AND NOT DEFINED(DISABLE_GFX)}
165 // default ENABLE/DISABLE gfx
166 {$IFDEF HEADLESS}
167 {$DEFINE DISABLE_GFX}
168 {$ELSE}
169 {$DEFINE ENABLE_GFX}
170 {$ENDIF}
171 {$ENDIF}
173 {$IF DEFINED(ENABLE_GIBS) AND DEFINED(DISABLE_GIBS)}
174 {$ERROR Select ENABLE_GIBS or DISABLE_GIBS}
175 {$ELSEIF NOT DEFINED(ENABLE_GIBS) AND NOT DEFINED(DISABLE_GIBS)}
176 // default ENABLE/DISABLE gibs
177 {$IFDEF HEADLESS}
178 {$DEFINE DISABLE_GIBS}
179 {$ELSE}
180 {$DEFINE ENABLE_GIBS}
181 {$ENDIF}
182 {$ENDIF}
184 {$IF DEFINED(ENABLE_SHELLS) AND DEFINED(DISABLE_SHELLS)}
185 {$ERROR Select ENABLE_SHELLS or DISABLE_SHELLS}
186 {$ELSEIF NOT DEFINED(ENABLE_SHELLS) AND NOT DEFINED(DISABLE_SHELLS)}
187 // default ENABLE/DISABLE gibs
188 {$IFDEF HEADLESS}
189 {$DEFINE DISABLE_SHELLS}
190 {$ELSE}
191 {$DEFINE ENABLE_SHELLS}
192 {$ENDIF}
193 {$ENDIF}
195 {$IF DEFINED(ENABLE_CORPSES) AND DEFINED(DISABLE_CORPSES)}
196 {$ERROR Select ENABLE_CORPSES or DISABLE_CORPSES}
197 {$ELSEIF NOT DEFINED(ENABLE_CORPSES) AND NOT DEFINED(DISABLE_CORPSES)}
198 // default ENABLE/DISABLE corpses
199 {$IFDEF HEADLESS}
200 {$DEFINE DISABLE_CORPSES}
201 {$ELSE}
202 {$DEFINE ENABLE_CORPSES}
203 {$ENDIF}
204 {$ENDIF}
206 {$IF DEFINED(USE_SYSSTUB)}
207 {$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
208 {$ERROR Only one system driver must be selected!}
209 {$ENDIF}
210 {$ELSEIF DEFINED(USE_SDL)}
211 {$IF DEFINED(USE_SYSSTUB) OR DEFINED(USE_SDL2)}
212 {$ERROR Only one system driver must be selected!}
213 {$ENDIF}
214 {$IFDEF USE_SDLMIXER}
215 {$ERROR SDL_mixer not supported with SDL 1.2.x}
216 {$ENDIF}
217 {$ELSEIF DEFINED(USE_SDL2)}
218 {$IF DEFINED(USE_SYSSTUB) OR DEFINED(USE_SDL)}
219 {$ERROR Only one system driver must be selected!}
220 {$ENDIF}
221 {$ELSE}
222 {$DEFINE USE_SDL2}
223 {.$ERROR System driver not selected. Use -dUSE_SYSSTUB or -dUSE_SDL or -dUSE_SDL2}
224 {$ENDIF}
226 {$IF DEFINED(USE_SOUNDSTUB)}
227 {$IF DEFINED(USE_SDLMIXER) OR DEFINED(USE_FMOD) OR DEFINED(USE_OPENAL)}
228 {$ERROR Only one sound driver must be selected!}
229 {$ENDIF}
230 {$ELSEIF DEFINED(USE_SDLMIXER)}
231 {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_FMOD) OR DEFINED(USE_OPENAL)}
232 {$ERROR Only one sound driver must be selected!}
233 {$ENDIF}
234 {$ELSEIF DEFINED(USE_FMOD)}
235 {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_SDLMIXER) OR DEFINED(USE_OPENAL)}
236 {$ERROR Only one sound driver must be selected!}
237 {$ENDIF}
238 {$ELSEIF DEFINED(USE_OPENAL)}
239 {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_SDLMIXER) OR DEFINED(USE_FMOD)}
240 {$ERROR Only one sound driver must be selected!}
241 {$ENDIF}
242 {$ELSE}
243 {$IFDEF IN_TOOLS}
244 {$DEFINE USE_SOUNDSTUB}
245 {$ELSE}
246 {$ERROR Sound driver not selected. Use -dUSE_SOUNDSTUB or -dUSE_SDLMIXER or -dUSE_FMOD or -dUSE_OPENAL}
247 {$ENDIF}
248 {$ENDIF}
250 {$IF DEFINED(USE_GLSTUB)}
251 {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
252 {$ERROR Only one render driver must be selected!}
253 {$ENDIF}
254 {$ELSEIF DEFINED(USE_GLES1)}
255 {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_OPENGL)}
256 {$ERROR Only one render driver must be selected!}
257 {$ENDIF}
258 {$ELSEIF DEFINED(USE_OPENGL)}
259 {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1)}
260 {$ERROR Only one render driver must be selected!}
261 {$ENDIF}
262 {$ELSE}
263 {$DEFINE USE_OPENGL}
264 {.$ERROR Render driver not selected. Use -dUSE_GLSTUB or -dUSE_GLES1 or -dUSE_OPENGL}
265 {$ENDIF}
267 {$IFDEF ENABLE_HOLMES}
268 {$IFNDEF USE_SDL2}
269 {$ERROR Holmes supported only with SDL2}
270 {$ENDIF}
271 {$IFNDEF USE_OPENGL}
272 {$ERROR Holmes supported only with desktop OpenGL}
273 {$ENDIF}
274 {$ENDIF}