/
Config.cmake
603 lines (482 loc) · 22.9 KB
/
Config.cmake
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
#
# dtool/Config.cmake
#
# This file defines certain configuration variables that are written
# into the various make scripts. It is processed by CMake to
# generate build scripts appropriate to each environment.
#
include(CMakeDependentOption)
# Define the plaform we are building on.
# The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN"
# are automatically provided by CMAKE. "APPLE" is also provided by
# CMAKE but may be True on systems that are not OS X.
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
set(IS_LINUX 1)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(IS_OSX 1)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(IS_FREEBSD 1)
endif()
# Define the type of build we are setting up.
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
Release RelWithDebInfo Debug MinSizeRel Distribution)
# Provide convenient boolean expression based on build type
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(IS_DEBUG_BUILD True)
set(IS_NOT_DEBUG_BUILD False)
else()
set(IS_DEBUG_BUILD False)
set(IS_NOT_DEBUG_BUILD True)
endif()
if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel")
set(IS_MINSIZE_BUILD True)
set(IS_NOT_MINSIZE_BUILD False)
else()
set(IS_MINSIZE_BUILD False)
set(IS_NOT_MINSIZE_BUILD True)
endif()
if(CMAKE_BUILD_TYPE MATCHES "Distribution")
set(IS_DIST_BUILD True)
set(IS_NOT_DIST_BUILD False)
else()
set(IS_DIST_BUILD False)
set(IS_NOT_DIST_BUILD True)
endif()
# Are we building with static or dynamic linking?
option(BUILD_SHARED_LIBS
"Causes subpackages to be built separately -- setup for dynamic linking.
Utilities/tools/binaries/etc are then dynamically linked to the
libraries instead of being statically linked." ON)
option(BUILD_METALIBS
"Should we build 'metalibs' -- fewer, larger libraries that contain the bulk
of the code instead of many smaller components. Note that turning this off
will still result in the 'metalibs' being built, but they will instead be many
smaller stub libraries and not 'meta' libraries." ON)
# The character used to separate components of an OS-specific
# directory name depends on the platform (it is '/' on Unix, '\' on
# Windows). That character selection is hardcoded into Panda and
# cannot be changed here. (Note that an internal Panda filename
# always uses the forward slash, '/', to separate the components of a
# directory name.)
# There's a different character used to separate the complete
# directory names in a search path specification. On Unix, the
# normal convention is ':', on Windows, it has to be ';', because the
# colon is already used to mark the drive letter. This character is
# selectable here. Most users won't want to change this. If
# multiple characters are placed in this string, any one of them may
# be used as a separator character.
if(WIN32)
set(DEFAULT_PATHSEP ";")
else()
set(DEFAULT_PATHSEP ":")
endif()
# Panda uses prc files for runtime configuration. There are many
# compiled-in options to customize the behavior of the prc config
# system; most users won't need to change any of them. Feel free to
# skip over all of the PRC_* variables defined here.
# The default behavior is to search for files names *.prc in the
# directory specified by the PRC_DIR environment variable, and then
# to search along all of the directories named by the PRC_PATH
# environment variable. Either of these variables might be
# undefined; if both of them are undefined, the default is to search
# in the directory named here by DEFAULT_PRC_DIR.
# By default, we specify the <auto>/etc dir, which is a special
# syntax that causes it to automatically search up the directory
# tree starting at the location of libpandaexpress.dll for any
# directories called 'etc'.
set(DEFAULT_PRC_DIR "<auto>etc" CACHE STRING
"The compiled-in default directory to look for the Config.prc file,
in the absence of the PRC_DIR environment variable set, and in
the absence of anything specified via the configpath directive.")
# You can specify the names of the environment variables that are
# used to specify the search location(s) for prc files at runtime.
# These are space-separated lists of environment variable names.
# Specify empty string for either one of these to disable the
# feature. For instance, redefining PRC_DIR_ENVVARS here to
# PRC_DIR would cause the environment variable $PRC_DIR
# to be consulted at startup instead of the default value of
# $PANDA_PRC_DIR.
set(PRC_DIR_ENVVARS "PANDA_PRC_DIR" CACHE STRING
"The compiled-in name of the environment variable(s) that contain
the name of a single directory in which to search for prc files.")
set(PRC_PATH_ENVVARS "PANDA_PRC_PATH" CACHE STRING
"The compiled-in name of the environment variable(s) that contain
the name of multiple directories, separated by DEFAULT_PATHSEP, in
which to search for prc files.")
# You can specify the name of the file(s) to search for in the above
# paths to be considered a config file. This should be a
# space-separated list of filename patterns. This is *.prc by
# default; normally there's no reason to change this.
set(PRC_PATTERNS "*.prc" CACHE STRING
"The filename(s) to search for in the above paths. Normally this is
*.prc.")
# You can optionally encrypt your prc file(s) to help protect them
# from curious eyes. You have to specify the encryption key, which
# gets hard-coded into the executable. (This feature provides mere
# obfuscation, not real security, since the encryption key can
# potentially be extracted by a hacker.) This requires building with
# OpenSSL.
set(PRC_ENCRYPTED_PATTERNS "*.prc.pe" CACHE STRING
"The filename(s) for encrypted prc files.")
set(PRC_ENCRYPTION_KEY "" CACHE STRING
"The encryption key used to decrypt any encrypted prc files
identified by PRC_ENCRYPTED_PATTERNS.")
# One unusual feature of config is the ability to execute one or more
# of the files it discovers as if it were a program, and then treat
# the output of this program as a prc file. If you want to use this
# feature, define this variable to the filename pattern or patterns
# for such executable-style config programs (e.g. *prc.exe). This
# can be the same as the above if you like this sort of ambiguity; in
# that case, config will execute the file if it appears to be
# executable; otherwise, it will simply read it.
set(PRC_EXECUTABLE_PATTERNS "" CACHE STRING
"The filename(s) to search for, and execute, in the above paths.
Normally this is empty.")
# If you do use the above feature, you'll need another environment
# variable that specifies additional arguments to pass to the
# executable programs. The default definition, given here, makes
# that variable be $PANDA_PRC_XARGS. Sorry, the same arguments
# must be supplied to all executables in a given runtime session.
set(PRC_EXECUTABLE_ARGS_ENVVAR "PANDA_PRC_XARGS" CACHE STRING
"The environment variable that defines optional args to pass to
executables found that match one of the above patterns.")
# You can implement signed prc files, if you require this advanced
# feature. This allows certain config variables to be set only by a
# prc file that has been provided by a trusted source. To do this,
# first install and compile Dtool with OpenSSL and run the program
# make-prc-key, and then specify here the output filename generated
# by that program, and then recompile Dtool.
set(PRC_PUBLIC_KEYS_FILENAME "" CACHE STRING "")
# By default, the signed-prc feature, above, is enabled only for a
# release build. In a normal development environment, any prc file
# can set any config variable, whether or not it is signed. Set
# this variable true or false to explicitly enable or disable this
# feature.
#XXX For which build types should this be enabled?
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(DEFAULT_PRC_RESPECT_TRUST_LEVEL ON)
else()
set(DEFAULT_PRC_RESPECT_TRUST_LEVEL OFF)
endif()
option(PRC_RESPECT_TRUST_LEVEL
"Define if we want to enable the trust_level feature of prc config
variables. This requires OpenSSL and PRC_PUBLIC_KEYS_FILENAME,
above." ${DEFAULT_PRC_RESPECT_TRUST_LEVEL})
# If trust level is in effect, this specifies the default trust level
# for any legacy (Dconfig) config variables (that is, variables
# created using the config.GetBool(), etc. interface, rather than the
# newer ConfigVariableBool interface).
set(PRC_DCONFIG_TRUST_LEVEL "0" CACHE STRING
"The trust level value for any legacy (DConfig) variables.")
# If trust level is in effect, you may globally increment the
# (mis)trust level of all variables by the specified amount.
# Incrementing this value by 1 will cause all variables to require at
# least a level 1 signature.
set(PRC_INC_TRUST_LEVEL "0" CACHE STRING
"The amount by which we globally increment the trust level.")
# Similarly, the descriptions are normally saved only in a
# development build, not in a release build. Set this value true to
# explicitly save them anyway.
#XXX only for release-release builds
option(PRC_SAVE_DESCRIPTIONS
"Define if you want to save the descriptions for ConfigVariables."
ON)
mark_as_advanced(DEFAULT_PRC_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS
PRC_PATTERNS PRC_ENCRYPTED_PATTERNS PRC_ENCRYPTION_KEY
PRC_EXECUTABLE_PATTERNS PRC_EXECUTABLE_ARGS_ENVVAR
PRC_PUBLIC_KEYS_FILENAME PRC_RESPECT_TRUST_LEVEL
PRC_DCONFIG_TRUST_LEVEL PRC_INC_TRUST_LEVEL PRC_SAVE_DESCRIPTIONS)
#
# This is the end of the PRC variable customization section. The
# remaining variables are of general interest to everyone.
#
option(HAVE_P3D_PLUGIN
"You may define this to build or develop the plugin." OFF)
option(HAVE_P3D_RTDIST
"You may define this to build or develop the Panda3D rtdist,
the environment packaged up for distribution with the plugin."
OFF)
if(HAVE_P3D_RTDIST)
set(PANDA_PACKAGE_VERSION "local_dev" CACHE STRING "")
set(PANDA_PACKAGE_HOST_URL "http://localhost/" CACHE STRING "")
endif()
mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST)
# The following options relate to interrogate, the tool that is
# used to generate bindings for non-C++ languages.
option(WANT_INTERROGATE
"Do you want to include Interrogate in the installation? This
program reads C++ source files and generates bindings for another
language. If you won't be building interfaces for other languages,
you don't need the program." ON)
cmake_dependent_option(INTERROGATE_PYTHON_INTERFACE
"Do you want to generate a Python-callable interrogate interface?
This is only necessary if you plan to make calls into Panda from a
program written in Python. This is done only if HAVE_PYTHON is also
true." ON "HAVE_PYTHON" OFF)
set(INTERROGATE_C_INTERFACE
"Do you want to generate a C-callable interrogate interface? This
generates an interface similar to the Python interface above, with
a C calling convention. It should be useful for most other kinds
of scripting language; the VR Studio used to use this to make calls
into Panda from Squeak." OFF)
set(INTERROGATE_OPTIONS "-fnames;-string;-refcount;-assert" CACHE STRING
"What additional options should be passed to interrogate when
generating either of the above two interfaces? Generally, you
probably don't want to mess with this.")
option(INTERROGATE_VERBOSE
"Set this if you would like interrogate to generate advanced
debugging information." OFF)
mark_as_advanced(INTERROGATE_OPTIONS)
#
# The following options have to do with the memory allocation system
# that will be used by Panda3D.
#
option(DO_MEMORY_USAGE
"Do you want to compile in support for tracking memory usage? This
enables you to define the variable 'track-memory-usage' at runtime
to help track memory leaks, and also report total memory usage on
PStats. There is some small overhead for having this ability
available, even if it is unused." ${IS_DEBUG_BUILD})
option(SIMULATE_NETWORK_DELAY
"This option compiles in support for simulating network delay via
the min-lag and max-lag prc variables. It adds a tiny bit of
overhead even when it is not activated, so it is typically enabled
only in a development build." ${IS_DEBUG_BUILD})
option(SUPPORT_IMMEDIATE_MODE
"This option compiles in support for immediate-mode OpenGL
rendering. Since this is normally useful only for researching
buggy drivers, and since there is a tiny bit of per-primitive
overhead to have this option available even if it is unused, it is
by default enabled only in a development build. This has no effect
on DirectX rendering." ${IS_DEBUG_BUILD})
option(NOTIFY_DEBUG
"Do you want to include the 'debug' and 'spam' Notify messages?
Normally, these are stripped out when we build for release, but sometimes it's
useful to keep them around. Turn this setting on to achieve that." ${IS_DEBUG_BUILD})
option(SUPPORT_FIXED_FUNCTION
"This option compiles in support for the fixed-function OpenGL
pipeline. It is only really useful to turn this off if you are targeting
an OpenGL ES 2 system." ON)
option(USE_MEMORY_DLMALLOC
"This is an optional alternative memory-allocation scheme
available within Panda. You can experiment with it to see
if it gives better performance than the system malloc(), but
at the time of this writing, it doesn't appear that it does." OFF)
option(USE_MEMORY_PTMALLOC2
"This is an optional alternative memory-allocation scheme
available within Panda. You can experiment with it to see
if it gives better performance than the system malloc(), but
at the time of this writing, it doesn't appear that it does." OFF)
option(MEMORY_HOOK_DO_ALIGN
"Set this true if you prefer to use the system malloc library even
if 16-byte alignment must be performed on top of it, wasting up to
30% of memory usage. If you do not set this, and 16-byte alignment
is required and not provided by the system malloc library, then an
alternative malloc system (above) will be used instead." OFF)
option(USE_DELETED_CHAIN
"Define this true to use the DELETED_CHAIN macros, which support
fast re-use of existing allocated blocks, minimizing the low-level
calls to malloc() and free() for frequently-created and -deleted
objects. There's usually no reason to set this false, unless you
suspect a bug in Panda's memory management code." ON)
mark_as_advanced(DO_MEMORY_USAGE SIMULATE_NETWORK_DELAY
SUPPORT_IMMEDIATE_MODE USE_MEMORY_DLMALLOC USE_MEMORY_PTMALLOC2
MEMORY_HOOK_DO_ALIGN USE_DELETED_CHAIN)
#
# This section relates to mobile-device/phone support and options
#
# iPhone support
set(BUILD_IPHONE "" CACHE STRING
"Panda contains some experimental code to compile for IPhone. This
requires the Apple IPhone SDK, which is currently only available
for OS X platforms. Set this to either 'iPhoneSimulator' or
'iPhoneOS'. Note that this is still *experimental* and incomplete!
Don't enable this unless you know what you're doing!")
set_property(CACHE BUILD_IPHONE PROPERTY STRINGS "" iPhoneSimulator iPhoneOS)
# Android support
option(BUILD_ANDROID
"Panda contains some experimental code to compile for Android.
This requires the Google Android NDK. Besides BUILD_ANDROID, you'll
also have to set ANDROID_NDK_HOME." OFF)
set(ANDROID_NDK_HOME "" CACHE STRING
"The location of the Android NDK directory. ANDROID_NDK_HOME may
not contain any spaces.")
set(ANDROID_ABI "armeabi-v7a" CACHE STRING
"Can be be set to armeabi-v7a, arm64-v8a, x86, or x86_64,
depending on which architecture should be targeted.")
set_property(CACHE ANDROID_ABI PROPERTY STRINGS
armeabi-v7a arm64-v8a x86 x86_64)
set(ANDROID_STL "c++_shared" CACHE STRING "")
set(ANDROID_PLATFORM "android-14" CACHE STRING "")
set(ANDROID_ARCH "arm" CACHE STRING "")
if(ANDROID_ARCH STREQUAL "arm")
set(ANDROID_TOOLCHAIN "arm-linux-androideabi")
else()
set(ANDROID_TOOLCHAIN "")
endif()
mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL
ANDROID_PLATFORM ANDROID_ARCH)
#
# Now let's check for the presence of various thirdparty libraries.
#
# By default, we'll assume the user only wants to run with Debug
# python if he has to--that is, on Windows when building a debug build.
if(WIN32 AND IS_DEBUG_BUILD)
set(USE_DEBUG_PYTHON ON)
else()
set(USE_DEBUG_PYTHON OFF)
endif()
option(HAVE_VIDEO4LINUX
"Set this to enable webcam support on Linux." ${IS_LINUX})
# If you are having trouble linking in OpenGL extension functions at
# runtime for some reason, you can set this variable. It also,
# requires you to install the OpenGL header files and compile-time
# libraries appropriate to the version you want to compile against.
set(MIN_GL_VERSION "1 1" CACHE STRING
"The variable is the major, minor version of OpenGL, separated by a
space (instead of a dot). Thus, \"1 1\" means OpenGL version 1.1.
This defines the minimum runtime version of OpenGL that Panda will
require. Setting it to a higher version will compile in hard
references to the extension functions provided by that OpenGL
version and below, which may reduce runtime portability to other
systems, but it will avoid issues with getting extension function
pointers.")
# Should build tinydisplay?
option(HAVE_TINYDISPLAY
"Builds TinyDisplay, a light software renderer based on TinyGL,
that is built into Panda. TinyDisplay is not as full-featured as Mesa
but is many times faster." ${IS_NOT_MINSIZE_BUILD})
# Is SDL installed, and where?
set(Threads_FIND_QUIETLY TRUE) # Fix for builtin FindSDL
set(Eigen3_FIND_QUIETLY TRUE) # Fix for builtin FindSDL
set(PythonLibs_FIND_QUIETLY TRUE) # Fix for builtin FindSDL
set(PythonInterp_FIND_QUIETLY TRUE) # Fix for builtin FindSDL
find_package(SDL QUIET)
package_option(SDL
"The SDL library is useful only for tinydisplay, and is not even
required for that, as tinydisplay is also supported natively on
each supported platform.")
# Cleanup after builtin FindSDL
mark_as_advanced(SDLMAIN_LIBRARY)
mark_as_advanced(SDL_INCLUDE_DIR)
mark_as_advanced(SDL_LIBRARY)
mark_as_advanced(SDL_LIBRARY_TEMP)
if(HAVE_GL AND HAVE_X11 AND NOT APPLE)
option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." ON)
else()
option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." OFF)
endif()
option(LINK_IN_GLXGETPROCADDRESS
"Define this to compile in a reference to the glXGetProcAddress().
This is only relevant from platforms using OpenGL under X."
OFF)
if(WIN32 AND HAVE_GL)
option(HAVE_WGL "Enable WGL. Requires OpenGL on Windows." ON)
else()
option(HAVE_WGL "Enable WGL. Requires OpenGL on Windows." OFF)
endif()
cmake_dependent_option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." ON
"APPLE" OFF)
#
# Miscellaneous settings
#
option(WANT_NATIVE_NET
"Define this true to build the low-level native network
implementation. Normally this should be set true." ON)
option(HAVE_NET
"Do you want to build the high-level network interface? This layers
on top of the low-level native_net interface, specified above.
Normally, if you build NATIVE_NET, you will also build NET."
${WANT_NATIVE_NET})
option(HAVE_EGG
"Do you want to build the egg loader? Usually there's no reason to
avoid building this, unless you really want to make a low-footprint
build (such as, for instance, for the iPhone)." ON)
option(HAVE_AUDIO
"Do you want to build the audio interface?" ON)
option(DO_PSTATS
"Enable the pstats client?" ON)
option(USE_PANDAFILESTREAM
"Enable the PandaFileStream implementation of pfstream etc.?" ON)
# These image formats don't require the assistance of a third-party
# library to read and write, so there's normally no reason to disable
# them int he build, unless you are looking to reduce the memory footprint.
option(HAVE_SGI_RGB "Enable support for loading SGI RGB images."
${IS_NOT_MINSIZE_BUILD})
option(HAVE_TGA "Enable support for loading TGA images."
${IS_NOT_MINSIZE_BUILD})
option(HAVE_IMG "Enable support for loading IMG images."
${IS_NOT_MINSIZE_BUILD})
option(HAVE_SOFTIMAGE_PIC
"Enable support for loading SOFTIMAGE PIC images."
${IS_NOT_MINSIZE_BUILD})
option(HAVE_BMP "Enable support for loading BMP images."
${IS_NOT_MINSIZE_BUILD})
option(HAVE_PNM "Enable support for loading PNM images."
${IS_NOT_MINSIZE_BUILD})
mark_as_advanced(HAVE_SGI_RGB HAVE_TGA
HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM)
# How to invoke bison and flex. Panda takes advantage of some
# bison/flex features, and therefore specifically requires bison and
# flex, not some other versions of yacc and lex. However, you only
# need to have these programs if you need to make changes to the
# bison or flex sources (see the next point, below).
find_package(BISON QUIET)
find_package(FLEX QUIET)
# You may not even have bison and flex installed. If you don't, no
# sweat; Panda ships with the pre-generated output of these programs,
# so you don't need them unless you want to make changes to the
# grammars themselves (files named *.yxx or *.lxx).
set(HAVE_BISON ${BISON_FOUND})
set(HAVE_FLEX ${FLEX_FOUND})
### Configure threading support ###
set(CMAKE_THREAD_PREFER_PTHREAD ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads QUIET)
set(THREADS_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT})
# Add basic use flag for threading
package_option(THREADS
"If on, compile Panda3D with threading support.
Building in support for threading will enable Panda to take
advantage of multiple CPU's if you have them (and if the OS
supports kernel threads running on different CPU's), but it will
slightly slow down Panda for the single CPU case."
IMPORTED_AS Threads::Threads)
# Configure debug threads
option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ${IS_DEBUG_BUILD})
option(SIMPLE_THREADS
"If on, compile with simulated threads. Threads, by default, use
OS-provided threading constructs, which usually allows for full
multithreading support (i.e. the program can use multiple CPU's).
On the other hand, compiling in this full OS-provided support can
impose some substantial runtime overhead, making the application
run slower on a single-CPU machine. This settings avoid the overhead,
but still gain some of the basic functionality of threads." OFF)
option(OS_SIMPLE_THREADS
"If on, OS threading constructs will be used to perform context switches.
A mutex is used to ensure that only one thread runs at a time, so the
normal SIMPLE_THREADS optimizations still apply, and the normal
SIMPLE_THREADS scheduler is used to switch between threads (instead
of the OS scheduler). This may be more portable and more reliable,
but it is a hybrid between user-space threads and os-provided threads." ON)
### Configure pipelining ###
option(DO_PIPELINING "If on, compile with pipelined rendering." ON)
### Miscellaneous configuration
option(COMPILE_IN_DEFAULT_FONT
"If on, compiles in a default font, so that every TextNode will always
have a font available without requiring the user to specify one.
When turned off, the generated library will save a few kilobytes."
${IS_NOT_MINSIZE_BUILD})
option(STDFLOAT_DOUBLE
"Define this true to compile a special version of Panda to use a
'double' floating-precision type for most internal values, such as
positions and transforms, instead of the standard single-precision
'float' type. This does not affect the default numeric type of
vertices, which is controlled by the runtime config variable
vertices-float64." OFF)