summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/egl-static/SConscript
blob: 83937fe61aded7695976b99ca13bad9fd7d41430 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#######################################################################
# SConscript for egl-static target

Import('*')

env = env.Clone()

env.Append(CPPPATH = [
    '#/include',
    '#/src/loader',
    '#/src/egl/main',
    '#/src/gallium/auxiliary',
    '#/src/gallium/drivers',
    '#/src/gallium/include',
    '#/src/gallium/winsys',
    '#/src/gallium/state_trackers/egl',
    '#/src/gallium/state_trackers/vega',
    '#/src/mesa',
])

env.Append(CPPDEFINES = [
    'GALLIUM_SOFTPIPE',
    'GALLIUM_RBUG',
    'GALLIUM_TRACE',
    'GALLIUM_GALAHAD',
    '_EGL_MAIN=_eglBuiltInDriverGALLIUM',
])

env.Prepend(LIBS = [
    softpipe,
    rbug,
    trace,
    galahad,
    libloader,
    gallium,
    egl,
    st_egl,
])

if env['llvm']:
    env.Append(CPPDEFINES = ['GALLIUM_LLVMPIPE'])
    env.Prepend(LIBS = [llvmpipe])

sources = [
    'egl.c',
    'egl_pipe.c',
    'egl_st.c',
]

if env['platform'] == 'windows':
    sources.append('#src/egl/main/egl.def')

    env.Append(LIBS = [
        'gdi32',
        'user32',
        'kernel32',
        'ws2_32',
    ])

    env.Prepend(LIBS = [
        ws_gdi,
    ])

# OpenGL ES and OpenGL
if env['gles']:
    env.Append(CPPDEFINES = [
        'FEATURE_GL=1',
        'FEATURE_ES1=1',
        'FEATURE_ES2=1'
    ])
    env.Prepend(LIBPATH = [shared_glapi.dir])
    # manually add LIBPREFIX on windows
    glapi_name = 'glapi' if env['platform'] != 'windows' else 'libglapi'
    env.Prepend(LIBS = [glapi_name, glsl, mesa])

# OpenVG
if True:
    env.Append(CPPDEFINES = ['FEATURE_VG=1'])
    env.Prepend(LIBPATH = [openvg.dir])
    # manually add LIBPREFIX on windows
    openvg_name = 'OpenVG' if env['platform'] != 'windows' else 'libOpenVG'
    env.Prepend(LIBS = [openvg_name, st_vega])

if env['HAVE_X11']:
    env.Prepend(LIBS = [
        ws_xlib,
    ])
    env.PkgUseModules('X11')

# pipe drivers
if env['HAVE_DRM']:
    env.PkgUseModules('DRM')

    if env['HAVE_DRM_INTEL']:
        env.PkgUseModules('DRM_INTEL')
        env.Append(CPPDEFINES = ['_EGL_PIPE_I915'])
        env.Prepend(LIBS = [
            i915drm,
            i915,
            ws_wrapper,
        ])

    env.Append(CPPDEFINES = ['_EGL_PIPE_VMWGFX'])
    env.Prepend(LIBS = [
        svgadrm,
        svga,
    ])

# libEGL.dll
env['LIBPREFIX'] = 'lib'
env['SHLIBPREFIX'] = 'lib'

egl_gallium = env.SharedLibrary(
    target ='EGL',
    source = sources,
)

env.Depends(egl_gallium, [openvg])

egl_gallium = env.InstallSharedLibrary(egl_gallium, version=(1, 4, 0))

env.Alias('egl-gallium', egl_gallium)