/
makepanda.py
executable file
·6108 lines (5233 loc) · 262 KB
/
makepanda.py
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
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
########################################################################
#
# To build panda using this script, type 'makepanda.py' on unix
# or 'makepanda.bat' on windows, and examine the help-text.
# Then run the script again with the appropriate options to compile
# panda3d.
#
########################################################################
try:
import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
if sys.platform == "darwin" or sys.version_info >= (2, 6):
import plistlib
if sys.version_info >= (3, 0):
import queue
else:
import Queue as queue
except KeyboardInterrupt:
raise
except:
print("You are either using an incomplete or an old version of Python!")
print("Please install the development package of Python and try again.")
exit(1)
from makepandacore import *
from distutils.util import get_platform
import time
import os
import sys
########################################################################
##
## PARSING THE COMMAND LINE OPTIONS
##
## You might be tempted to change the defaults by editing them
## here. Don't do it. Instead, create a script that compiles
## panda with your preferred options. Or, create
## a 'makepandaPreferences' file and put it into your python path.
##
########################################################################
COMPILER=0
INSTALLER=0
WHEEL=0
RUNTESTS=0
GENMAN=0
COMPRESSOR="zlib"
THREADCOUNT=0
CFLAGS=""
CXXFLAGS=""
LDFLAGS=""
DISTRIBUTOR=""
VERSION=None
DEBVERSION=None
WHLVERSION=None
RPMRELEASE="1"
GIT_COMMIT=None
MAJOR_VERSION=None
OSXTARGET=None
global STRDXSDKVERSION, BOOUSEINTELCOMPILER
STRDXSDKVERSION = 'default'
WINDOWS_SDK = None
MSVC_VERSION = None
BOOUSEINTELCOMPILER = False
OPENCV_VER_23 = False
PLATFORM = None
COPY_PYTHON = True
if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
PkgListSet(["PYTHON", "DIRECT", # Python support
"GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
"EGL", # OpenGL (ES) integration
"EIGEN", # Linear algebra acceleration
"OPENAL", "FMODEX", # Audio playback
"VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
"ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
"SPEEDTREE", # SpeedTree
"ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
"FREETYPE", "HARFBUZZ", # Text rendering
"VRPN", "OPENSSL", # Transport
"FFTW", # Algorithm helpers
"ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
"GTK2", # GTK2 is used for PStats on Unix
"MFC", "WX", "FLTK", # Used for web plug-in only
"ROCKET", # GUI libraries
"COCOA", # Mac OS X toolkits
"X11", # Unix platform support
"PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
"SKEL", # Example SKEL project
"PANDAFX", # Some distortion special lenses
"PANDAPARTICLESYSTEM", # Built in particle system
"CONTRIB", # Experimental
"SSE2", "NEON", # Compiler features
])
CheckPandaSourceTree()
def keyboardInterruptHandler(x,y):
exit("keyboard interrupt")
signal.signal(signal.SIGINT, keyboardInterruptHandler)
########################################################################
##
## Command-line parser.
##
## You can type "makepanda --help" to see all the options.
##
########################################################################
def usage(problem):
if (problem):
print("")
print("Error parsing command-line input: %s" % (problem))
print("")
print("Makepanda generates a 'built' subdirectory containing a")
print("compiled copy of Panda3D. Command-line arguments are:")
print("")
print(" --help (print the help message you're reading now)")
print(" --verbose (print out more information)")
print(" --tests (run the test suite)")
print(" --installer (build an installer)")
print(" --wheel (build a pip-installable .whl)")
print(" --optimize X (optimization level can be 1,2,3,4)")
print(" --version X (set the panda version number)")
print(" --lzma (use lzma compression when building Windows installer)")
print(" --distributor X (short string identifying the distributor of the build)")
print(" --outputdir X (use the specified directory instead of 'built')")
print(" --threads N (use the multithreaded build system. see manual)")
print(" --osxtarget N (the OS X version number to build for (OS X only))")
print(" --override \"O=V\" (override dtool_config/prc option value)")
print(" --static (builds libraries for static linking)")
print(" --target X (experimental cross-compilation (android only))")
print(" --arch X (target architecture for cross-compilation)")
print("")
for pkg in PkgListGet():
p = pkg.lower()
print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
if sys.platform != 'win32':
print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
print("")
print(" --nothing (disable every third-party lib)")
print(" --everything (enable every third-party lib)")
print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)")
print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
print("")
print("The simplest way to compile panda is to just type:")
print("")
print(" makepanda --everything")
print("")
os._exit(1)
def parseopts(args):
global INSTALLER,WHEEL,RUNTESTS,GENMAN,DISTRIBUTOR,VERSION
global COMPRESSOR,THREADCOUNT,OSXTARGET
global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT
global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
global COPY_PYTHON
# Options for which to display a deprecation warning.
removedopts = [
"use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
"no-carbon", "universal",
]
# All recognized options.
longopts = [
"help","distributor=","verbose","osxtarget=","tests",
"optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
"version=","lzma","no-python","threads=","outputdir=","override=",
"static","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
"directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
"target=", "arch=", "git-commit=", "no-copy-python",
] + removedopts
anything = 0
optimize = ""
target = None
target_arch = None
clean_build = False
for pkg in PkgListGet():
longopts.append("use-" + pkg.lower())
longopts.append("no-" + pkg.lower())
longopts.append(pkg.lower() + "-incdir=")
longopts.append(pkg.lower() + "-libdir=")
try:
opts, extras = getopt.getopt(args, "", longopts)
for option, value in opts:
if (option=="--help"): raise Exception
elif (option=="--optimize"): optimize=value
elif (option=="--installer"): INSTALLER=1
elif (option=="--tests"): RUNTESTS=1
elif (option=="--wheel"): WHEEL=1
elif (option=="--verbose"): SetVerbose(True)
elif (option=="--distributor"): DISTRIBUTOR=value
elif (option=="--genman"): GENMAN=1
elif (option=="--everything"): PkgEnableAll()
elif (option=="--nothing"): PkgDisableAll()
elif (option=="--threads"): THREADCOUNT=int(value)
elif (option=="--outputdir"): SetOutputDir(value.strip())
elif (option=="--osxtarget"): OSXTARGET=value.strip()
elif (option=="--target"): target = value.strip()
elif (option=="--arch"): target_arch = value.strip()
elif (option=="--nocolor"): DisableColors()
elif (option=="--version"):
match = re.match(r'^\d+\.\d+(\.\d+)+', value)
if not match:
usage("version requires three digits")
WHLVERSION = value
VERSION = match.group()
elif (option=="--lzma"): COMPRESSOR="lzma"
elif (option=="--override"): AddOverride(value.strip())
elif (option=="--static"): SetLinkAllStatic(True)
elif (option=="--debversion"): DEBVERSION=value
elif (option=="--rpmrelease"): RPMRELEASE=value
elif (option=="--git-commit"): GIT_COMMIT=value
# Backward compatibility, OPENGL was renamed to GL
elif (option=="--use-opengl"): PkgEnable("GL")
elif (option=="--no-opengl"): PkgDisable("GL")
elif (option=="--directx-sdk"):
STRDXSDKVERSION = value.strip().lower()
if STRDXSDKVERSION == '':
print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
STRDXSDKVERSION = 'default'
elif (option=="--windows-sdk"):
WINDOWS_SDK = value.strip().lower()
elif (option=="--msvc-version"):
MSVC_VERSION = value.strip().lower()
elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
elif (option=="--clean"): clean_build = True
elif (option=="--no-copy-python"): COPY_PYTHON = False
elif (option[2:] in removedopts):
Warn("Ignoring removed option %s" % (option))
else:
for pkg in PkgListGet():
if option == "--use-" + pkg.lower():
PkgEnable(pkg)
break
elif option == "--no-" + pkg.lower():
PkgDisable(pkg)
break
elif option == "--" + pkg.lower() + "-incdir":
PkgSetCustomLocation(pkg)
IncDirectory(pkg, value)
break
elif option == "--" + pkg.lower() + "-libdir":
PkgSetCustomLocation(pkg)
LibDirectory(pkg, value)
break
if (option == "--everything" or option.startswith("--use-")
or option == "--nothing" or option.startswith("--no-")):
anything = 1
except:
usage(sys.exc_info()[1])
if not anything:
usage("You should specify a list of packages to use or --everything to enable all packages.")
if (optimize==""): optimize = "3"
if OSXTARGET:
try:
maj, min = OSXTARGET.strip().split('.')
OSXTARGET = int(maj), int(min)
assert OSXTARGET[0] == 10
except:
usage("Invalid setting for OSXTARGET")
else:
OSXTARGET = None
if target is not None or target_arch is not None:
SetTarget(target, target_arch)
try:
SetOptimize(int(optimize))
assert GetOptimize() in [1, 2, 3, 4]
except:
usage("Invalid setting for OPTIMIZE")
if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
usage("Invalid SHA-1 hash given for --git-commit option!")
if GetTarget() == 'windows':
if not MSVC_VERSION:
print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
MSVC_VERSION = (14, 0)
else:
try:
MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
if (len(MSVC_VERSION) == 1):
MSVC_VERSION += (0,)
except:
usage("Invalid setting for --msvc-version")
if MSVC_VERSION < (14, 0):
warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
print("=========================================================================")
print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
print(warn_prefix + "For more information, or any questions, please visit:")
print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
print("=========================================================================")
sys.stdout.flush()
time.sleep(1.0)
sys.exit(1)
if not WINDOWS_SDK:
print("No Windows SDK version specified. Defaulting to '7.1'.")
WINDOWS_SDK = '7.1'
if clean_build and os.path.isdir(GetOutputDir()):
print("Deleting %s" % (GetOutputDir()))
shutil.rmtree(GetOutputDir())
parseopts(sys.argv[1:])
########################################################################
##
## Handle environment variables.
##
########################################################################
if ("CFLAGS" in os.environ):
CFLAGS = os.environ["CFLAGS"].strip()
if ("CXXFLAGS" in os.environ):
CXXFLAGS = os.environ["CXXFLAGS"].strip()
if ("RPM_OPT_FLAGS" in os.environ):
CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
if ("LDFLAGS" in os.environ):
LDFLAGS = os.environ["LDFLAGS"].strip()
os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
if GetHost() == "darwin" and OSXTARGET is not None:
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
########################################################################
##
## Configure things based on the command-line parameters.
##
########################################################################
if VERSION is None:
# Take the value from the setup.cfg file.
VERSION = GetMetadataValue('version')
if WHLVERSION is None:
WHLVERSION = VERSION
print("Version: %s" % VERSION)
if DEBVERSION is None:
DEBVERSION = VERSION
MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
# Now determine the distutils-style platform tag for the target system.
target = GetTarget()
if target == 'windows':
if GetTargetArch() == 'x64':
PLATFORM = 'win-amd64'
else:
PLATFORM = 'win32'
elif target == 'darwin':
if OSXTARGET:
osxver = OSXTARGET
else:
maj, min = platform.mac_ver()[0].split('.')[:2]
osxver = int(maj), int(min)
arch_tag = GetTargetArch()
PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
elif target == 'linux' and (os.path.isfile("/lib/libc-2.5.so") or os.path.isfile("/lib64/libc-2.5.so")) and os.path.isdir("/opt/python"):
# This is manylinux1. A bit of a sloppy check, though.
if GetTargetArch() in ('x86_64', 'amd64'):
PLATFORM = 'manylinux1-x86_64'
else:
PLATFORM = 'manylinux1-i686'
elif not CrossCompiling():
if HasTargetArch():
# Replace the architecture in the platform string.
platform_parts = get_platform().rsplit('-', 1)
target_arch = GetTargetArch()
if target_arch == 'amd64':
target_arch = 'x86_64'
PLATFORM = platform_parts[0] + '-' + target_arch
else:
# We're not cross-compiling; just take the host arch.
PLATFORM = get_platform()
else:
target_arch = GetTargetArch()
if target_arch == 'amd64':
target_arch = 'x86_64'
PLATFORM = '{0}-{1}'.format(target, target_arch)
print("Platform: %s" % PLATFORM)
outputdir_suffix = ""
if DISTRIBUTOR == "":
DISTRIBUTOR = "makepanda"
if not IsCustomOutputDir():
if GetTarget() == "windows" and GetTargetArch() == 'x64':
outputdir_suffix += '_x64'
SetOutputDir("built" + outputdir_suffix)
if (INSTALLER) and (PkgSkip("PYTHON")) and GetTarget() == 'windows':
exit("Cannot build installer on Windows without python")
if WHEEL and PkgSkip("PYTHON"):
exit("Cannot build wheel without Python")
if not os.path.isdir("contrib"):
PkgDisable("CONTRIB")
########################################################################
##
## Load the dependency cache.
##
########################################################################
LoadDependencyCache()
########################################################################
##
## Locate various SDKs.
##
########################################################################
MakeBuildTree()
SdkLocateDirectX(STRDXSDKVERSION)
SdkLocateMaya()
SdkLocateMax()
SdkLocateMacOSX(OSXTARGET)
SdkLocatePython(False)
SdkLocateWindows(WINDOWS_SDK)
SdkLocatePhysX()
SdkLocateSpeedTree()
SdkLocateAndroid()
SdkAutoDisableDirectX()
SdkAutoDisableMaya()
SdkAutoDisableMax()
SdkAutoDisablePhysX()
SdkAutoDisableSpeedTree()
if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
print("=========================================================================")
print(warn_prefix + "Python 2.7 will reach EOL after December 31, 2019, and will not")
print(warn_prefix + "be supported after that date. Please ensure you are prepared")
print(warn_prefix + "by planning your upgrade to Python 3 now.")
print("=========================================================================")
sys.stdout.flush()
# Give the user some time to contemplate their sins
time.sleep(6.0)
########################################################################
##
## Choose a Compiler.
##
## This should also set up any environment variables needed to make
## the compiler work.
##
########################################################################
if GetHost() == 'windows' and GetTarget() == 'windows':
COMPILER = "MSVC"
SdkLocateVisualStudio(MSVC_VERSION)
else:
COMPILER = "GCC"
SetupBuildEnvironment(COMPILER)
########################################################################
##
## External includes, external libraries, and external defsyms.
##
########################################################################
IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
IncDirectory("ALWAYS", GetOutputDir()+"/include")
if (COMPILER == "MSVC"):
PkgDisable("X11")
PkgDisable("GLES")
PkgDisable("GLES2")
PkgDisable("EGL")
PkgDisable("COCOA")
DefSymbol("FLEX", "YY_NO_UNISTD_H")
if (PkgSkip("PYTHON")==0):
IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
for pkg in PkgListGet():
if (PkgSkip(pkg)==0):
if (pkg[:4]=="MAYA"):
IncDirectory(pkg, SDK[pkg] + "/include")
DefSymbol(pkg, "MAYAVERSION", pkg)
DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
elif (pkg[:3]=="MAX"):
IncDirectory(pkg, SDK[pkg] + "/include")
IncDirectory(pkg, SDK[pkg] + "/include/CS")
IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
DefSymbol(pkg, "MAX", pkg)
if (int(pkg[3:]) >= 2013):
DefSymbol(pkg, "UNICODE", "")
DefSymbol(pkg, "_UNICODE", "")
elif (pkg[:2]=="DX"):
IncDirectory(pkg, SDK[pkg] + "/include")
elif GetThirdpartyDir() is not None:
IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
for pkg in DXVERSIONS:
if (PkgSkip(pkg)==0):
vnum=pkg[2:]
if GetTargetArch() == 'x64':
LibDirectory(pkg, SDK[pkg] + '/lib/x64')
else:
LibDirectory(pkg, SDK[pkg] + '/lib/x86')
LibDirectory(pkg, SDK[pkg] + '/lib')
LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
LibName(pkg, 'dxerr.lib')
else:
LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
#LibName(pkg, 'ddraw.lib')
LibName(pkg, 'dxguid.lib')
if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
# dxerr needs this for __vsnwprintf definition.
LibName(pkg, 'legacy_stdio_definitions.lib')
if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
LibName("WINSOCK", "wsock32.lib")
LibName("WINSOCK2", "wsock32.lib")
LibName("WINSOCK2", "ws2_32.lib")
LibName("WINCOMCTL", "comctl32.lib")
LibName("WINCOMDLG", "comdlg32.lib")
LibName("WINUSER", "user32.lib")
LibName("WINMM", "winmm.lib")
LibName("WINIMM", "imm32.lib")
LibName("WINKERNEL", "kernel32.lib")
LibName("WINOLE", "ole32.lib")
LibName("WINOLEAUT", "oleaut32.lib")
LibName("WINOLDNAMES", "oldnames.lib")
LibName("WINSHELL", "shell32.lib")
LibName("WINGDI", "gdi32.lib")
LibName("ADVAPI", "advapi32.lib")
LibName("IPHLPAPI", "iphlpapi.lib")
LibName("SETUPAPI", "setupapi.lib")
LibName("GL", "opengl32.lib")
LibName("GLES", "libgles_cm.lib")
LibName("GLES2", "libGLESv2.lib")
LibName("EGL", "libEGL.lib")
LibName("MSIMG", "msimg32.lib")
if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
if (PkgSkip("OPENSSL")==0):
if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
else:
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
if (PkgSkip("PNG")==0):
if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
else:
LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
if (PkgSkip("TIFF")==0):
if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
else:
LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
if (PkgSkip("OPENEXR")==0):
suffix = ""
if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
suffix = "-2_2"
elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
suffix = "-2_3"
if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
suffix += "_s"
LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
if suffix == "-2_2":
LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
else:
LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
if (PkgSkip("HARFBUZZ")==0):
LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
if (PkgSkip("FCOLLADA")==0):
LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
if (PkgSkip("ASSIMP")==0):
LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
if (PkgSkip("SQUISH")==0):
if GetOptimize() <= 2:
LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
else:
LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
if (PkgSkip("ROCKET")==0):
LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
if (PkgSkip("PYTHON")==0):
LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
if (GetOptimize() <= 3):
LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
if (PkgSkip("OPENAL")==0):
LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
# Link OpenAL Soft statically.
DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
if (PkgSkip("ODE")==0):
LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
DefSymbol("ODE", "dSINGLE", "")
if (PkgSkip("FMODEX")==0):
if (GetTargetArch() == 'x64'):
LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
else:
LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
if (PkgSkip("VORBIS")==0):
for lib in ('ogg', 'vorbis', 'vorbisfile'):
path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
if not os.path.isfile(path):
path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
LibName("VORBIS", path)
if (PkgSkip("OPUS")==0):
IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
for lib in ('ogg', 'opus', 'opusfile'):
path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
if not os.path.isfile(path):
path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
LibName("OPUS", path)
for pkg in MAYAVERSIONS:
if (PkgSkip(pkg)==0):
LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
for pkg in MAXVERSIONS:
if (PkgSkip(pkg)==0):
LibName(pkg, SDK[pkg] + '/lib/core.lib')
LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
LibName(pkg, SDK[pkg] + '/lib/geom.lib')
LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
if (PkgSkip("PHYSX")==0):
if GetTargetArch() == 'x64':
LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
else:
LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
if (PkgSkip("SPEEDTREE")==0):
if GetTargetArch() == 'x64':
libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
p64ext = '64'
else:
libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
p64ext = ''
debugext = ''
if (GetOptimize() <= 2): debugext = "_d"
libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
SDK["SPEEDTREEVERSION"], p64ext, debugext)
LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
if (SDK["SPEEDTREEAPI"] == "OpenGL"):
LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
LibName("SPEEDTREE", "glu32.lib")
IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
if (PkgSkip("BULLET")==0):
suffix = '.lib'
if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
suffix = '_x64.lib'
LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
if (COMPILER=="GCC"):
if GetTarget() != "darwin":
PkgDisable("COCOA")
#if (PkgSkip("PYTHON")==0):
# IncDirectory("PYTHON", SDK["PYTHON"])
if (GetHost() == "darwin"):
if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
IncDirectory("FREETYPE", "/usr/X11/include")
IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
LibDirectory("FREETYPE", "/usr/X11/lib")
if (GetHost() == "freebsd"):
IncDirectory("ALWAYS", "/usr/local/include")
LibDirectory("ALWAYS", "/usr/local/lib")
if (os.path.isdir("/usr/PCBSD")):
IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
if GetTarget() != "windows":
PkgDisable("DIRECTCAM")
fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
# WARNING! The order of the ffmpeg libraries matters!
ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
assimp_libs = ("libassimp", "libassimpd")
# Name pkg-config libs, include(dir)s
SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
# Copy freetype libraries to be specified after harfbuzz libraries as well,
# because there's a circular dependency between the two libraries.
if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
for (opt, name) in LIBNAMES:
if opt == "FREETYPE":
LibName("HARFBUZZ", name)
if not PkgSkip("FFMPEG"):
if GetTarget() == "darwin":
LibName("FFMPEG", "-framework VideoDecodeAcceleration")
elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
# Needed when linking ffmpeg statically on Linux.
LibName("FFMPEG", "-Wl,-Bsymbolic")
if PkgSkip("FFMPEG") or GetTarget() == "darwin":
cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
if cv_lib == "opencv_core":
OPENCV_VER_23 = True
SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
else:
SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
else:
PkgDisable("OPENCV")
if GetTarget() == "darwin" and not PkgSkip("OPENAL"):
LibName("OPENAL", "-framework AudioToolbox")
LibName("OPENAL", "-framework CoreAudio")
if not PkgSkip("ASSIMP") and \
os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
# Also pick up IrrXML, which is needed when linking statically.
irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
if os.path.isfile(irrxml):
LibName("ASSIMP", irrxml)
rocket_libs = ("RocketCore", "RocketControls")
if (GetOptimize() <= 3):
rocket_libs += ("RocketDebugger",)
rocket_libs += ("boost_python",)
SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
if not PkgSkip("PYTHON"):
python_lib = SDK["PYTHONVERSION"]
SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
if GetTarget() == "linux":
LibName("PYTHON", "-lutil")
LibName("PYTHON", "-lrt")
SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
SmartPkgEnable("GTK2", "gtk+-2.0")
if GetTarget() != 'darwin':
# CgGL is covered by the Cg framework, and we don't need X11 components on OSX
if not PkgSkip("NVIDIACG"):
SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
if GetHost() != "darwin":
# Workaround for an issue where pkg-config does not include this path
if GetTargetArch() in ("x86_64", "amd64"):
if (os.path.isdir("/usr/lib64/glib-2.0/include")):
IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
if not PkgSkip("X11"):
if (os.path.isdir("/usr/X11R6/lib64")):
LibDirectory("ALWAYS", "/usr/X11R6/lib64")
else:
LibDirectory("ALWAYS", "/usr/X11R6/lib")
elif not PkgSkip("X11"):
LibDirectory("ALWAYS", "/usr/X11R6/lib")
for pkg in MAYAVERSIONS:
if (PkgSkip(pkg)==0 and (pkg in SDK)):
if (GetHost() == "darwin"):
# Sheesh, Autodesk really can't make up their mind
# regarding the location of the Maya devkit on OS X.
if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
if (os.path.isdir(SDK[pkg] + "/lib")):
LibDirectory(pkg, SDK[pkg] + "/lib")
if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
IncDirectory(pkg, SDK[pkg] + "/devkit/include")
if (os.path.isdir(SDK[pkg] + "/include/maya")):
IncDirectory(pkg, SDK[pkg] + "/include")
else:
LibDirectory(pkg, SDK[pkg] + "/lib")
IncDirectory(pkg, SDK[pkg] + "/include")
DefSymbol(pkg, "MAYAVERSION", pkg)
if GetTarget() == 'darwin':
LibName("ALWAYS", "-framework AppKit")
LibName("IOKIT", "-framework IOKit")
LibName("QUARTZ", "-framework Quartz")
LibName("AGL", "-framework AGL")
LibName("CARBON", "-framework Carbon")
LibName("COCOA", "-framework Cocoa")
# Fix for a bug in OSX Leopard:
LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
# Temporary exceptions to removal of this flag
if not PkgSkip("ROCKET"):
LibName("ROCKET", "-undefined dynamic_lookup")
if not PkgSkip("FFMPEG"):
LibName("FFMPEG", "-undefined dynamic_lookup")
if not PkgSkip("ASSIMP"):
LibName("ASSIMP", "-undefined dynamic_lookup")
if not PkgSkip("OPENEXR"):
LibName("OPENEXR", "-undefined dynamic_lookup")
if not PkgSkip("VRPN"):
LibName("VRPN", "-undefined dynamic_lookup")
if GetTarget() == 'android':
LibName("ALWAYS", '-llog')
LibName("ANDROID", '-landroid')
LibName("JNIGRAPHICS", '-ljnigraphics')
for pkg in MAYAVERSIONS:
if (PkgSkip(pkg)==0 and (pkg in SDK)):
if GetTarget() == 'darwin':
LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
else:
LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
LibName(pkg, "-lOpenMaya")
LibName(pkg, "-lOpenMayaAnim")
LibName(pkg, "-lAnimSlice")
LibName(pkg, "-lDeformSlice")
LibName(pkg, "-lModifiers")
LibName(pkg, "-lDynSlice")
LibName(pkg, "-lKinSlice")
LibName(pkg, "-lModelSlice")
LibName(pkg, "-lNurbsSlice")
LibName(pkg, "-lPolySlice")
LibName(pkg, "-lProjectSlice")
LibName(pkg, "-lImage")
LibName(pkg, "-lShared")
LibName(pkg, "-lTranslators")
LibName(pkg, "-lDataModel")
LibName(pkg, "-lRenderModel")
LibName(pkg, "-lNurbsEngine")
LibName(pkg, "-lDependEngine")
LibName(pkg, "-lCommandEngine")
LibName(pkg, "-lFoundation")
LibName(pkg, "-lIMFbase")
if GetTarget() != 'darwin':
LibName(pkg, "-lOpenMayalib")
else:
LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
if (PkgSkip("PHYSX")==0):
IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
LibDirectory("PHYSX", SDK["PHYSXLIBS"])
if (GetHost() == "darwin"):
LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
else:
LibName("PHYSX", "-lPhysXLoader")
LibName("PHYSX", "-lNxCharacter")
DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
if GetLinkAllStatic():
DefSymbol("ALWAYS", "LINK_ALL_STATIC")
if GetTarget() == 'android':
DefSymbol("ALWAYS", "ANDROID")
if not PkgSkip("EIGEN"):
if GetOptimize() >= 3:
if COMPILER == "MSVC":
# Squeeze out a bit more performance on MSVC builds...
# Only do this if EIGEN_NO_DEBUG is also set, otherwise it
# will turn them into runtime assertions.
DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
########################################################################
##
## Give a Status Report on Command-Line Options
##
########################################################################
def printStatus(header,warnings):
if GetVerbose():
print("")
print("-------------------------------------------------------------------")
print(header)
tkeep = ""
tomit = ""