5cb7960f9b59e5fec1708cfbb428995b14845016
[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 env = env.Clone()
11
12 env.Tool('python')
13
14 env.Tool('swig')
15 env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe'])
16 env.Append(SWIGFLAGS = ['-python', '-keyword'])
17
18 env.Append(CPPPATH = '.')
19
20 if env['platform'] == 'windows':
21 env.Append(LIBS = [
22 'opengl32',
23 'gdi32',
24 'user32',
25 'kernel32',
26 'ws2_32',
27 ])
28 else:
29 env.Append(CPPDEFINES = ['GCC_HASCLASSVISIBILITY'])
30 env.Append(LIBS = [
31 'GL',
32 'X11',
33 ])
34
35 sources = [
36 'gallium.i',
37 'st_device.c',
38 'st_sample.c',
39 'st_hardpipe_winsys.c',
40 'st_softpipe_winsys.c',
41 ]
42
43 env.Prepend(LIBS = [
44 ws_null,
45 trace,
46 gallium,
47 ])
48
49 if env['llvm']:
50 env.Append(CPPDEFINES = ['HAVE_LLVMPIPE'])
51 env.Prepend(LIBS = [llvmpipe])
52 if True:
53 env.Append(CPPDEFINES = ['HAVE_SOFTPIPE'])
54 env.Prepend(LIBS = [softpipe])
55
56 env['no_import_lib'] = 1
57
58 pyst = env.SharedLibrary(
59 target = '_gallium',
60 source = sources,
61 )
62
63 env.Alias('python', pyst)