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