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