1848b8605SmrgImport('*')
2848b8605Smrg
3848b8605Smrgenv = env.Clone()
4848b8605Smrg
5848b8605Smrgenv.Prepend(CPPPATH = [
6848b8605Smrg    '#src',
7848b8605Smrg    '#src/mapi',
8848b8605Smrg    '#src/mesa',
9848b8605Smrg    Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers
10b8e80941Smrg    Dir('../../../mapi/glapi'), # src/mapi/glapi build path
11848b8605Smrg])
12848b8605Smrg
13848b8605Smrgenv.Prepend(LIBS = [
14848b8605Smrg    mesautil,
15848b8605Smrg    glapi,
16b8e80941Smrg    compiler,
17848b8605Smrg    mesa,
18b8e80941Smrg    spirv,
19b8e80941Smrg    nir,
20848b8605Smrg    glsl,
21848b8605Smrg])
22848b8605Smrg
23848b8605Smrgsources = [
24848b8605Smrg    'osmesa.c',
25848b8605Smrg]
26848b8605Smrg
27848b8605Smrgif env['platform'] == 'windows':
28848b8605Smrg    env.AppendUnique(CPPDEFINES = [
29848b8605Smrg        '_GDI32_', # prevent wgl* being declared __declspec(dllimport)
30b8e80941Smrg        'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
31b8e80941Smrg        '_GLAPI_NO_EXPORTS', # prevent _glapi_* from being declared __declspec(dllimport)
32848b8605Smrg    ])
33848b8605Smrg
34848b8605Smrg    sources += ['osmesa.def']
35b8e80941Smrg
36848b8605Smrgosmesa = env.SharedLibrary(
37848b8605Smrg    target ='osmesa',
38848b8605Smrg    source = sources,
39848b8605Smrg)
40848b8605Smrg
41848b8605Smrgenv.Alias('osmesa', osmesa)
42