diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc
index ee78b4f355d9501813a5975a4da1e0e1b8f32750..909a81373e8e31313174124b661a1ccb4d314ccb 100644 (file)
--- a/src/shared/a_modes.inc
+++ b/src/shared/a_modes.inc
// compiler options, common for all game modules
// compiler options, common for all game modules
-{.$MODE DELPHI}
{$MODE OBJFPC}
{$MODESWITCH ADVANCEDRECORDS+}
{$MODE OBJFPC}
{$MODESWITCH ADVANCEDRECORDS+}
{$MODESWITCH PROPERTIES+}
{$MODESWITCH REPEATFORWARD+} // Implementation and Forward declaration must match completely.
{$MODESWITCH RESULT+}
{$MODESWITCH PROPERTIES+}
{$MODESWITCH REPEATFORWARD+} // Implementation and Forward declaration must match completely.
{$MODESWITCH RESULT+}
-{$MODESWITCH TYPEHELPERS-} // Allow the use of type helpers.
-{$MODESWITCH UNICODESTRINGS-}
+{$MODESWITCH TYPEHELPERS+} // Allow the use of type helpers.
{$MODESWITCH UNICODESTRINGS-}
{$MODESWITCH UNICODESTRINGS-}
+{$IFDEF DARWIN}
+ {$MODESWITCH OBJECTIVEC1}
+{$ENDIF}
{$ASSERTIONS ON}
{$BITPACKING OFF}
{$BOOLEVAL OFF}
{$COPERATORS ON}
{$EXTENDEDSYNTAX ON}
{$ASSERTIONS ON}
{$BITPACKING OFF}
{$BOOLEVAL OFF}
{$COPERATORS ON}
{$EXTENDEDSYNTAX ON}
-{$FPUTYPE SSE}
+{$IFDEF CPU386}
+ {$FPUTYPE SSE}
+{$ENDIF}
{$GOTO ON}
{$IEEEERRORS OFF}
{$INLINE ON}
{$GOTO ON}
{$IEEEERRORS OFF}
{$INLINE ON}
{$POINTERMATH ON}
{$RANGECHECKS OFF}
{$SAFEFPUEXCEPTIONS OFF}
{$POINTERMATH ON}
{$RANGECHECKS OFF}
{$SAFEFPUEXCEPTIONS OFF}
-{$SCOPEDENUMS OFF} // this will possibly be changed later
+{$SCOPEDENUMS ON} // this may be changed later
{$SMARTLINK ON}
{$TYPEDADDRESS ON}
{$SMARTLINK ON}
{$TYPEDADDRESS ON}
-{$TYPEINFO OFF}
+{$TYPEINFO ON}
{$VARSTRINGCHECKS OFF}
{$S-} // disable stack checking
{$VARSTRINGCHECKS OFF}
{$S-} // disable stack checking
{$HINTS OFF}
{$ELSE}
{$STACKFRAMES OFF}
{$HINTS OFF}
{$ELSE}
{$STACKFRAMES OFF}
+ {$HINTS OFF}
+ {$DEFINE D2F_MORE_OPTIM}
{$ENDIF}
{$WARNINGS ON}
{$ENDIF}
{$WARNINGS ON}
-{$NOTES ON}
+{.$NOTES ON}
+{$IF DEFINED(D2F_DEBUG_OPTIM) or DEFINED(D2F_MORE_OPTIM)}
+ {$OPTIMIZATION DEADVALUES}
+ {$OPTIMIZATION CONSTPROP}
+ {$OPTIMIZATION DEADSTORE}
+{$ENDIF}
+
+{$IFDEF WIN32}
+ {$IFNDEF MSWINDOWS}
+ {$DEFINE MSWINDOWS}
+ {$ENDIF}
+{$ENDIF}
{$IFDEF MSWINDOWS}
{$IFNDEF WINDOWS}
{$DEFINE WINDOWS}
{$ENDIF WINDOWS}
{$IFDEF MSWINDOWS}
{$IFNDEF WINDOWS}
{$DEFINE WINDOWS}
{$ENDIF WINDOWS}
-{$ENDIF MSWINDOWS}
+{$ENDIF}
+
+(* --------- Build options check --------- *)
+
+{$IFDEF HEADLESS}
+ {$DEFINE USE_SYSSTUB}
+ {$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
+ {$WARNING System drivers not supported in headless mode. Force stub driver...}
+ {$UNDEF USE_SDL}
+ {$UNDEF USE_SDL2}
+ {$ENDIF}
+ {$DEFINE USE_GLSTUB}
+ {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
+ {$WARNING Render drivers not needed in headless mode. Force stub driver...}
+ {$UNDEF USE_GLES1}
+ {$UNDEF USE_OPENGL}
+ {$ENDIF}
+ {$IFDEF ENABLE_HOLMES}
+ {$WARNING Holmes in headless mode has no sense. Disabled.}
+ {$UNDEF ENABLE_HOLMES}
+ {$ENDIF}
+ {$IFDEF ENABLE_MENU}
+ {$WARNING Menu in headless mode has no sense. Disabled.}
+ {$UNDEF ENABLE_MENU}
+ {$DEFINE DISABLE_MENU}
+ {$ENDIF}
+ {$IFDEF ENABLE_TOUCH}
+ {$WARNING Touch screen in headless mode has no sense. Disabled.}
+ {$UNDEF ENABLE_TOUCH}
+ {$DEFINE DISABLE_TOUCH}
+ {$ENDIF}
+{$ENDIF}
+
+{$IF DEFINED(ENABLE_MENU) AND DEFINED(DISABLE_MENU)}
+ {$ERROR Select ENABLE_MENU or DISABLE_MENU}
+{$ELSEIF NOT DEFINED(ENABLE_MENU) AND NOT DEFINED(DISABLE_MENU)}
+ // defaut ENABLE/DISABLE menu
+ {$IFDEF HEADLESS}
+ {$DEFINE DISABLE_MENU}
+ {$ELSE}
+ {$DEFINE ENABLE_MENU}
+ {$ENDIF}
+{$ENDIF}
+
+{$IF DEFINED(ENABLE_TOUCH) AND DEFINED(DISABLE_TOUCH)}
+ {$ERROR Select ENABLE_TOUCH or DISABLE_TOUCH}
+{$ELSEIF NOT DEFINED(ENABLE_TOUCH) AND NOT DEFINED(DISABLE_TOUCH)}
+ // defaut ENABLE/DISABLE touch
+ {$IFDEF HEADLESS}
+ {$DEFINE DISABLE_TOUCH}
+ {$ELSE}
+ {$DEFINE ENABLE_TOUCH}
+ {$ENDIF}
+{$ENDIF}
+
+{$IF DEFINED(USE_SYSSTUB)}
+ {$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
+ {$ERROR Only one system driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_SDL)}
+ {$IF DEFINED(USE_SYSSTUB) OR DEFINED(USE_SDL2)}
+ {$ERROR Only one system driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_SDL2)}
+ {$IF DEFINED(USE_SYSSTUB) OR DEFINED(USE_SDL)}
+ {$ERROR Only one system driver must be selected!}
+ {$ENDIF}
+{$ELSE}
+ {$DEFINE USE_SDL2}
+ {.$ERROR System driver not selected. Use -dUSE_SYSSTUB or -dUSE_SDL or -dUSE_SDL2}
+{$ENDIF}
+
+{$IF DEFINED(USE_SOUNDSTUB)}
+ {$IF DEFINED(USE_SDLMIXER) OR DEFINED(USE_FMOD) OR DEFINED(USE_OPENAL)}
+ {$ERROR Only one sound driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_SDLMIXER)}
+ {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_FMOD) OR DEFINED(USE_OPENAL)}
+ {$ERROR Only one sound driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_FMOD)}
+ {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_SDLMIXER) OR DEFINED(USE_OPENAL)}
+ {$ERROR Only one sound driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_OPENAL)}
+ {$IF DEFINED(USE_SOUNDSTUB) OR DEFINED(USE_SDLMIXER) OR DEFINED(USE_FMOD)}
+ {$ERROR Only one sound driver must be selected!}
+ {$ENDIF}
+{$ELSE}
+ {$IFDEF IN_TOOLS}
+ {$DEFINE USE_SOUNDSTUB}
+ {$ELSE}
+ {$ERROR Sound driver not selected. Use -dUSE_SOUNDSTUB or -dUSE_SDLMIXER or -dUSE_FMOD or -dUSE_OPENAL}
+ {$ENDIF}
+{$ENDIF}
+
+{$IF DEFINED(USE_GLSTUB)}
+ {$IF DEFINED(USE_GLES1) OR DEFINED(USE_OPENGL)}
+ {$ERROR Only one render driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_GLES1)}
+ {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_OPENGL)}
+ {$ERROR Only one render driver must be selected!}
+ {$ENDIF}
+{$ELSEIF DEFINED(USE_OPENGL)}
+ {$IF DEFINED(USE_GLSTUB) OR DEFINED(USE_GLES1)}
+ {$ERROR Only one render driver must be selected!}
+ {$ENDIF}
+{$ELSE}
+ {$DEFINE USE_OPENGL}
+ {.$ERROR Render driver not selected. Use -dUSE_GLSTUB or -dUSE_GLES1 or -dUSE_OPENGL}
+{$ENDIF}
+
+{$IFDEF ENABLE_HOLMES}
+ {$IFNDEF USE_SDL2}
+ {$ERROR Holmes supported only with SDL2}
+ {$ENDIF}
+ {$IFNDEF USE_OPENGL}
+ {$ERROR Holmes supported only with desktop OpenGL}
+ {$ENDIF}
+{$ENDIF}