File: castle-fpc.cfg

package info (click to toggle)
castle-game-engine 5.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 164,776 kB
  • ctags: 30,841
  • sloc: pascal: 168,882; cpp: 1,340; objc: 730; makefile: 492; sh: 477; xml: 434; php: 1
file content (287 lines) | stat: -rw-r--r-- 7,899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# -*- mode: shell-script -*-
#
# FPC configuration file for Castle Game Engine.
# Pretty much normal configuration for people that like modern ObjectPascal
# and ObjFpc mode.
#
# Accepts two switches: DEBUG and RELEASE. If you don't define any of them
# debug and optimizing code will be done according to compiler defaults.
# Never define both of them.
#
# Also accepts a switch KAMBI_CONFIG_PRIVATE.
# This is what I (Kambi) use on my own system.
# (It doesn't pass relative paths -Fu and -Fi then, I set them myself
# by my scripts).
#
# ----------------------------------------------------------------------

#IFDEF KAMBI_CONFIG_PRIVATE

  # Show logo (shows fpc version, usable for me since I use various fpc versions)
  -l

  # Show warnings+ notes+ hints+ info+ all_proc_decls.
  # I'm filtering output of fpc using grep, so I don't mind that FPC
  # outputs many hints that I usually want to ignore :
  # (later update: there are *so* many useless hints produces by FPC
  # that I decided to simply turn hints off).
  -vwni

#ELSE

  # However, when putting castle-fpc.cfg in my public sources release,
  # don't show all of this. So here's "official" -v<x> declaration :
  # (currently, show nothing)
  -v

#ENDIF

# Input/output checks : yes, always, even in release version -- my code
# depends on the fact that io errors in std Pascal funcs are checked
# automatically (and raise exceptions if SysUtils is compiled in)
-Ci

# syntax options --------------------------------------------------------

# Default mode.
#
# Since 2006-11, I use objfpc mode for everything. Some reasons why it's better
# over delphi mode:
# - There are some things strange in delphi mode, for compat with delphi/tp,
#   that sometimes bite me (like the fact that in FPC >= 2.0.3
#   Single(Integer) makes a variable typecast, not a value typecast).
# - Moreover, ObjFpc has many sensible improvements:
#   the whole way of assigning procedural variables
#   is much better ("@" is required, and assignment is always checked
#   for parameter correctness (in delphi mode @ may be omitted; when it's
#   not omitted, you can cheat and pass procedure with not matching params))
# - Check that method parameter names must differ from class
#   fields/methods/properties --- this is great.
-Mobjfpc

# macros on
-Sm
# c-like operators +=, -= etc.
-Sc
# allow LABEL and GOTO
-Sg
# inline allowed
-Si
# use ansistrings
-Sh

# units/includes paths --------------------------------------------------

# It seems that FPC does not define symbol UNIX before reading config file,
# even though it defines LINUX (or FREEBSD; I assume that this is also
# the case with DARWIN).
# But I need symbol UNIX *now* to include paths common for all UNIXes.
#IFDEF LINUX
  #DEFINE UNIX
#ENDIF
#IFDEF DARWIN
  #DEFINE UNIX
#ENDIF
#IFDEF FREEBSD
  #DEFINE UNIX
#ENDIF

# Looks like MSWINDOWS symbol needs to be fixed now, just like UNIX above.
#IFDEF WIN32
  #DEFINE MSWINDOWS
#ENDIF
#IFDEF WIN64
  #DEFINE MSWINDOWS
#ENDIF

#IFNDEF KAMBI_CONFIG_PRIVATE

  # Common paths for all OSes
  -Fusrc/base/
  -Fisrc/base/
  -Fusrc/fonts/
  -Fisrc/fonts/
  -Fusrc/opengl/
  -Fisrc/opengl/
  -Fisrc/opengl/glsl/
  -Fusrc/window/
  -Fisrc/window/
  -Fisrc/window/gtk/
  -Fusrc/images/
  -Fisrc/images/
  -Fusrc/3d/
  -Fisrc/3d/
  -Fusrc/3d/opengl/
  -Fisrc/3d/opengl/
  -Fusrc/x3d/
  -Fisrc/x3d/
  -Fisrc/x3d/teapot_data/
  -Fusrc/x3d/opengl/
  -Fisrc/x3d/opengl/
  -Fisrc/x3d/opengl/glsl/
  -Fusrc/audio/
  -Fisrc/audio/
  -Fusrc/net/
  -Fisrc/net/
  -Fusrc/castlescript/
  -Fisrc/castlescript/
  -Fusrc/ui/
  -Fisrc/ui/
  -Fusrc/ui/opengl/
  -Fisrc/ui/opengl/
  -Fusrc/game/
  -Fisrc/game/

  #IFDEF UNIX
    -Fusrc/base/unix/
    -Fisrc/base/unix/
    -Fusrc/opengl/unix/
    -Fisrc/opengl/unix/
    -Fusrc/window/unix/
    -Fisrc/window/unix/
  #ENDIF

  #IFDEF MSWINDOWS
    -Fusrc/base/windows/
    -Fisrc/base/windows/
    -Fusrc/fonts/windows/
    -Fusrc/opengl/windows/
    -Fisrc/opengl/windows/
    -Fusrc/window/windows/
    -Fisrc/window/windows/
    -Fusrc/ui/windows/
    -Fisrc/ui/windows/
  #ENDIF

  #IFDEF ANDROID
  -Fusrc/base/android/
  -Fisrc/base/android/
  #ENDIF

#ENDIF

# debug specific -------------------------------------------------

#IFDEF DEBUG
  #WRITE Compiling Debug Version

  # range checks
  -Cr
  # overflow checks
  -Co

  # Stack overflow checks.
  #
  # castle fails with stack checking errors on x86-64.
  # Otherwise, works OK, so I guess it's FPC bug.
  # TODO: make testcase and submit. For now, stack checking is not
  # done on x86-64.
  #
  # It also causes failures on Android with pthread in castleandroidnativeappglue.pas.
  #IFNDEF CPUX86_64
  #IFNDEF ANDROID
  -Ct
  #ENDIF
  #ENDIF

  # assertions checks
  -Sa

  # virtual method table checks
  -CR

  # debug info for gdb and browser.
  -g
  #-bl

  # LineMode unit, HeapTrc unit, checking pointer validity
  -gl

  #IFDEF KAMBI_CONFIG_PRIVATE

    # -gh is not used by default for public builds, because
    # -gh produces some problems when my programs exit with ProgramBreak or Halt:
    # we will always leak memory then. This is FPC bug (although
    # harmless, since in this case OS will free these leaks anyway,
    # and it's rumouredly unfixable). I can just ignore it, but for
    # casual user this may be confusing, as it suggests that "something
    # is wrong", while in fact all is OK.
    -gh

    # -gc is not used by default, because
    #
    # 1.It makes many false errors (when I dereference memory allocated
    #   by other libraries, e.g. libpng or gtk). I'm masking them by
    #
    #     { We dereference here memory allocated with PNG, so pointer checks
    #       will make false errors. }
    #     {$checkpointer off}
    #
    #     ....
    #
    #     {$ifdef KAMBI_CHECK_POINTER}
    #     { Turn checkpointer back on }
    #     {$checkpointer on}
    #     {$endif}
    #
    #   (I need -dKAMBI_CHECK_POINTER for this trick, since {$ifopt checkpointer}
    #   doesn't work.)
    #   But this masking is error prone, so a lot of valid code may still report
    #   false errors. IOW, unless you know what you're doing (and can
    #   recognize false error from a real one in the engine code), don't use -gc.
    #
    # 2.Also, -gc for whole code still makes code much slower.
    #
    # Note that -gc requires -gh because checking pointer
    # validity is part of HeapTrc unit.
    #-gc
    #-dKAMBI_CHECK_POINTER

  #ENDIF
#ENDIF

# profiling ------------------------------------------------------------------
#
# Profiling options should be used without -dDEBUG,
# -dDEBUG code may be (slightly) slower in (slightly)
# different places because of debug checks (range, overflow, stack checks etc.).
#
# They generally should be used with -dRELEASE, as you want to profile
# program timings experienced by the user, although sometimes -dRELASE may cause
# optimizations that may obfuscate profiler output.
# So sometimes yoy may want to undefine both DEBUG and RELEASE.

# gprof
# -pg

# valgrind
#-gl
#-gv

# release specific -----------------------------------------------

#IFDEF RELEASE
  #WRITE Compiling Release Version

  # optimize : level 2, faster code
  -O2
  #-OG # obsolete, FPC optimizes for faster code always

  # (Don't optimize for Pentium;
  #  1. there are still some people with older i386 processors ?
  #  2. these Pentium-specific optimizations don't seem to give *any*
  #     real improvement for my code (checked with rayhunter
  #     with FPC 1.0.10;  TODO -- do some speed checks with FPC 2.0.0))
  # Note: remember, if you enable it, wrap it in #IFDEF CPUI386
  # -Op2

  # (smartlink turned off because REALLY slows down compilation
  # and doesn't reduce size of my programs too much)
  #-CX
  #-XX

  # strip symbols from exe (symbols are used only in debugging)
  -Xs
#ENDIF

# eof --------------------------------------------------------------------------