Merge branch 'lp-offset-twoside'
[mesa.git] / src / gallium / state_trackers / python / SConscript
1 import sys
2 import os.path
3
4 Import('*')
5
6 if env['toolchain'] == 'crossmingw':
7 # Cross-compilation not supported
8 Return()
9
10 if not env.Detect(['swig']):
11 Return()
12
13 env = env.Clone()
14
15 env.Tool('python')
16
17 env.Tool('swig')
18 env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe'])
19 env.Append(SWIGFLAGS = ['-python', '-keyword'])
20
21 env.Append(CPPPATH = '.')
22
23 if env['platform'] == 'windows':
24 env.Append(LIBS = [
25 'opengl32',
26 'gdi32',
27 'user32',
28 'kernel32',
29 'ws2_32',
30 ])
31 else:
32 env.Append(CPPDEFINES = ['GCC_HASCLASSVISIBILITY'])
33 env.Append(LIBS = [
34 'GL',
35 'X11',
36 ])
37
38 sources = [
39 'gallium.i',
40 'st_device.c',
41 'st_sample.c',
42 'st_hardpipe_winsys.c',
43 'st_softpipe_winsys.c',
44 ]
45
46 env.Prepend(LIBS = [
47 ws_null,
48 trace,
49 gallium,
50 ])
51
52 if env['llvm']:
53 env.Append(CPPDEFINES = ['HAVE_LLVMPIPE'])
54 env.Prepend(LIBS = [llvmpipe])
55 if True:
56 env.Append(CPPDEFINES = ['HAVE_SOFTPIPE'])
57 env.Prepend(LIBS = [softpipe])
58
59 env['no_import_lib'] = 1
60
61 pyst = env.SharedLibrary(
62 target = '_gallium',
63 source = sources,
64 )
65
66 env.Alias('python', pyst)