summaryrefslogtreecommitdiff
path: root/src/glsl/SConscript
blob: 101487df9102ee1d073b5c7c877688a45be9f5cf (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
62
63
64
65
66
67
68
69
import common

Import('*')

env = env.Clone()

sources = [
    'pp/sl_pp_context.c',
    'pp/sl_pp_define.c',
    'pp/sl_pp_dict.c',
    'pp/sl_pp_error.c',
    'pp/sl_pp_expression.c',
    'pp/sl_pp_extension.c',
    'pp/sl_pp_if.c',
    'pp/sl_pp_line.c',
    'pp/sl_pp_macro.c',
    'pp/sl_pp_pragma.c',
    'pp/sl_pp_process.c',
    'pp/sl_pp_purify.c',
    'pp/sl_pp_token.c',
    'pp/sl_pp_token_util.c',
    'pp/sl_pp_version.c',
    'cl/sl_cl_parse.c',
]

glsl = env.StaticLibrary(
    target = 'glsl',
    source = sources,
)

Export('glsl')

env = env.Clone()

if env['platform'] == 'windows':
    env.PrependUnique(LIBS = [
        'user32',
    ])

env.Prepend(LIBS = [glsl])

env.Program(
    target = 'purify',
    source = ['apps/purify.c'],
)

env.Program(
    target = 'tokenise',
    source = ['apps/tokenise.c'],
)

env.Program(
    target = 'version',
    source = ['apps/version.c'],
)

env.Program(
    target = 'process',
    source = ['apps/process.c'],
)

glsl_compile = env.Program(
    target = 'compile',
    source = ['apps/compile.c'],
)

if env['platform'] == common.default_platform:
    # Only export the GLSL compiler when building for the host platform
    Export('glsl_compile')