1Import('*') 2 3env = env.Clone() 4 5env.Prepend(CPPPATH = [ 6 '#src/mapi', 7 '#src/mesa', 8]) 9 10env.Prepend(LIBS = [ 11 glapi, 12 mesa, 13 glsl, 14]) 15 16sources = [ 17 'osmesa.c', 18] 19 20if env['platform'] == 'windows': 21 env.AppendUnique(CPPDEFINES = [ 22 '_GDI32_', # prevent wgl* being declared __declspec(dllimport) 23 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 24 ]) 25 if not env['gles']: 26 # prevent _glapi_* from being declared __declspec(dllimport) 27 env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS']) 28 29 sources += ['osmesa.def'] 30 31osmesa = env.SharedLibrary( 32 target ='osmesa', 33 source = sources, 34) 35 36env.Alias('osmesa', osmesa) 37 38env.Depends(sources, glapi_headers) 39