summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/python/SConscript
blob: d0d141fd2496299b02ba3b3a01b8493e40ce6308 (plain)
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
import sys
import os.path

Import('*')

if 'python' in env['statetrackers'] and 0:
    # FIXME: Disable python state tracker until transfers are done by contexts  

    env = env.Clone()
    
    env.Tool('python')
    
    env.Tool('swig')
    env.Append(SWIGPATH = ['#src/gallium/include', '#src/gallium/include/pipe'])
    env.Append(SWIGFLAGS = ['-python', '-keyword'])
    
    env.Append(CPPPATH = '.')

    if env['platform'] == 'windows':
        env.Append(LIBS = [
            'opengl32',
            'gdi32',
            'user32',
            'kernel32',
            'ws2_32',
        ])
    else:
        env.Append(CPPDEFINES = ['GCC_HASCLASSVISIBILITY'])
        env.Append(LIBS = [
        	'GL',
            'X11',
        ])

    sources = [
        'gallium.i',
        'st_device.c',
        'st_sample.c',
        'st_hardpipe_winsys.c',
        'st_softpipe_winsys.c',
    ]

    env.Prepend(LIBS = [
        ws_null,
        trace,
        gallium,
    ])

    if 'llvmpipe' in env['drivers']:
        env.Append(CPPDEFINES = ['HAVE_LLVMPIPE'])
        env.Tool('llvm')
        env.Prepend(LIBS = [llvmpipe])
    if 'softpipe' in env['drivers']:
        env.Append(CPPDEFINES = ['HAVE_SOFTPIPE'])
        env.Prepend(LIBS = [softpipe])

    env['no_import_lib'] = 1

    env.SharedLibrary(
        target = '_gallium',
        source = sources,
    )