aboutsummaryrefslogtreecommitdiff
path: root/src/wscript_build
blob: b742b48e9ec90e3a478fc4c0554412738a33e4d3 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
all_sources = bld.path.ant_glob('*.cpp scene-ideas/*.cc scene-terrain/*.cpp')
common_sources = [f for f in all_sources if f.name.find('canvas-') == -1 and
                                            f.name.find('android') == -1 and
                                            f.name.find('egl-') == -1]
gl_sources = ['canvas-x11.cpp', 'canvas-x11-glx.cpp']
glesv2_sources = ['canvas-x11.cpp', 'canvas-x11-egl.cpp', 'egl-state.cpp']
gl_drm_sources = ['canvas-drm.cpp', 'egl-state.cpp']
glesv2_drm_sources = ['canvas-drm.cpp', 'egl-state.cpp']
libmatrix_sources = [f for f in bld.path.ant_glob('libmatrix/*.cc')
                     if not f.name.endswith('test.cc')]
includes = ['.', 'scene-ideas', 'scene-terrain']

if bld.env.USE_GL:
    bld(
        features = ['cxx', 'cxxstlib'],
        source   = libmatrix_sources,
        target   = 'matrix',
        lib      = ['m'],
        includes = ['.'],
        export_includes = 'libmatrix',
        defines  = ['USE_GL', 'USE_EXCEPTIONS']
        )
    bld(
        features     = ['cxx', 'cprogram'],
        source       = common_sources + gl_sources,
        target       = 'glmark2',
        use          = ['x11', 'gl', 'matrix', 'libpng12'],
        lib          = ['m', 'jpeg'],
        includes     = includes,
        defines      = ['USE_GL', 'USE_EXCEPTIONS']
        )

if bld.env.USE_GLESv2:
    bld(
        features = ['cxx', 'cxxstlib'],
        source   = libmatrix_sources,
        target   = 'matrix-es2',
        lib      = ['m'],
        includes = ['.'],
        export_includes = 'libmatrix',
        defines  = ['USE_GLESv2', 'USE_EXCEPTIONS']
        )
    bld(
        features     = ['cxx', 'cprogram'],
        source       = common_sources + glesv2_sources,
        target       = 'glmark2-es2',
        use          = ['x11', 'egl', 'glesv2', 'matrix-es2', 'libpng12'],
        lib          = ['m', 'dl', 'jpeg'],
        includes     = includes,
        defines      = ['USE_GLESv2', 'USE_EXCEPTIONS']
        )

if bld.env.USE_GL_DRM:
    bld(
        features = ['cxx', 'cxxstlib'],
        source   = libmatrix_sources,
        target   = 'matrix-drm',
        lib      = ['m'],
        includes = ['.'],
        export_includes = 'libmatrix',
        defines  = ['USE_DRM', '__GBM__', 'USE_GL', 'USE_EXCEPTIONS']
        )
    bld(
        features     = ['cxx', 'cprogram'],
        source       = common_sources + gl_drm_sources,
        target       = 'glmark2-drm',
        use          = ['egl', 'gl', 'matrix-drm', 'libpng12', 'drm', 'gbm'],
        lib          = ['m', 'jpeg', 'dl'],
        includes     = includes,
        defines      = ['USE_DRM', '__GBM__', 'USE_GL']
        )

if bld.env.USE_GLESv2_DRM:
    bld(
        features = ['cxx', 'cxxstlib'],
        source   = libmatrix_sources,
        target   = 'matrix-es2-drm',
        lib      = ['m'],
        includes = ['.'],
        export_includes = 'libmatrix',
        defines  = ['USE_DRM', '__GBM__', 'USE_GLESv2', 'USE_EXCEPTIONS']
        )
    bld(
        features     = ['cxx', 'cprogram'],
        source       = common_sources + glesv2_drm_sources,
        target       = 'glmark2-es2-drm',
        use          = ['egl', 'glesv2', 'matrix-es2-drm', 'libpng12', 'drm',
                        'gbm'],
        lib          = ['m', 'jpeg', 'dl'],
        includes     = includes,
        defines      = ['USE_DRM', '__GBM__', 'USE_GLESv2']
        )