mapi/vgapi: Add SConscript for Windows build.
[mesa.git] / src / mapi / vgapi / SConscript
1 #######################################################################
2 # SConscript for vgapi
3
4 from sys import executable as python_cmd
5
6 Import('*')
7
8 if env['platform'] != 'winddk':
9
10 env = env.Clone()
11
12 vgapi_header = env.CodeGenerate(
13 target = '#src/mapi/vgapi/vgapi_tmp.h',
14 script = '../mapi/mapi_abi.py',
15 source = 'vgapi.csv',
16 command = python_cmd + ' $SCRIPT -i vgapi/vgapi_defines.h $SOURCE > $TARGET'
17 )
18
19 env.Append(CPPDEFINES = [
20 'MAPI_ABI_HEADER=\\"vgapi/vgapi_tmp.h\\"',
21 'KHRONOS_DLL_EXPORTS',
22 ])
23
24 env.Append(CPPPATH = [
25 '#/include',
26 '#/src/mapi',
27 ])
28
29 mapi_sources = [
30 'entry.c',
31 'mapi.c',
32 'stub.c',
33 'table.c',
34 'u_current.c',
35 'u_execmem.c',
36 'u_thread.c',
37 ]
38
39 vgapi_objects = []
40 for s in mapi_sources:
41 o = env.Object(s[:-2], '../mapi/' + s)
42 vgapi_objects.append(o)
43
44 env.Depends(vgapi_objects, vgapi_header)
45
46 openvg = env.SharedLibrary(
47 target = 'libOpenVG',
48 source = vgapi_objects,
49 )
50
51 env.InstallSharedLibrary(openvg, version=(1, 0, 0))
52
53 vgapi = [env.FindIxes(openvg, 'LIBPREFIX', 'LIBSUFFIX')]
54
55 Export(['vgapi', 'vgapi_header'])