* integrate bFTGL with Scons
[blender.git] / extern / solid / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 solid_env = Environment(ENV = os.environ)
6
7 # Import the C flags set in the SConstruct file
8 Import ('cflags')
9 #Import ('cxxflags')
10 #Import ('defines')
11 Import ('user_options_dict')
12 #defines = ['QHULL', '_LIB']
13 defines = ['USE_DOUBLES','QHULL', '_LIB']
14 #cflags = []
15 cxxflags = []
16
17 if sys.platform=='win32':
18         defines += ['WIN32','NDEBUG', '_WINDOWS', '_LIB']
19         #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
20         cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
21 elif sys.platform=='linux2' or sys.platform=='linux-i386' or sys.platform=='freebsd4' or sys.platform=='freebsd5':
22         defines += ['NDEBUG']
23         cflags += ['-O2']
24 elif sys.platform=='darwin' :
25         defines += ['NDEBUG']
26         cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
27
28 else:
29     print "################################################"
30     print 
31     print "Check if solid builds on your platform correctly"
32     print "Add your platform specific defines"
33     print "and cflags / cxxflags to the"
34     print "extern/solid/SConscript file"
35
36 solid_env.Append (CCFLAGS = cflags)
37 solid_env.Append (CPPFLAGS = cxxflags)
38
39 solid_env.Append (CPPDEFINES = defines)
40
41 solid_sources = ['src/DT_C-api.cpp',
42                 'src/DT_Encounter.cpp',
43                 'src/DT_Object.cpp',
44                 'src/DT_RespTable.cpp',
45                 'src/DT_Scene.cpp']
46
47 convex_sources = ['src/convex/DT_Accuracy.cpp',
48                 'src/convex/DT_Box.cpp',
49                 'src/convex/DT_Cone.cpp',
50                 'src/convex/DT_Convex.cpp',
51                 'src/convex/DT_Cylinder.cpp',
52                 'src/convex/DT_Facet.cpp',
53                 'src/convex/DT_LineSegment.cpp',
54                 'src/convex/DT_PenDepth.cpp',
55                 'src/convex/DT_Point.cpp',
56                 'src/convex/DT_Polyhedron.cpp',
57                 'src/convex/DT_Polytope.cpp',
58                 'src/convex/DT_Sphere.cpp',
59                 'src/convex/DT_Triangle.cpp']
60                 
61 complex_sources = ['src/complex/DT_BBoxTree.cpp',
62                 'src/complex/DT_Complex.cpp']
63
64 broad_sources = ['src/broad/BP_C-api.cpp',
65                 'src/broad/BP_EndpointList.cpp',
66                 'src/broad/BP_Proxy.cpp',
67                 'src/broad/BP_Scene.cpp']
68
69 solid_env.Append (CPPPATH = ['include',
70                              'src',
71                              'src/broad',
72                              'src/complex',
73                              'src/convex',
74                              '../qhull/include'])
75 source_files = solid_sources + convex_sources + complex_sources + broad_sources
76
77 solid_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_solid', source=source_files)