X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglew%2FSConscript;h=4b5b5b8d0ffaff92dcde952a0069cc45df55d690;hb=0203136e69bfa711edd69a4f69c4539cd877b5cb;hp=1161be6e633e5731dfd24a8a5f9882211ba7d7a3;hpb=dceb09909ea9d6eaef0334897ebed6da45db6faa;p=mesa.git diff --git a/src/glew/SConscript b/src/glew/SConscript index 1161be6e633..4b5b5b8d0ff 100644 --- a/src/glew/SConscript +++ b/src/glew/SConscript @@ -1,29 +1,12 @@ Import('*') -if env['platform'] not in ['windows', 'linux']: - Return() - +# Shared environment settings env = env.Clone() -env.Append(CPPDEFINES = [ - 'GLEW_BUILD', - 'GLEW_STATIC', - #'GLEW_MX', # Multiple Rendering Contexts support -]) - env.PrependUnique(CPPPATH = [ '#/include', ]) -glew = env.StaticLibrary( - target = 'glew', - source = [ - 'glew.c', - ], -) - -env = env.Clone() - if env['platform'] == 'windows': env.PrependUnique(LIBS = [ 'glu32', @@ -32,19 +15,55 @@ if env['platform'] == 'windows': 'user32', ]) else: + env.Tool('x11') env.PrependUnique(LIBS = [ 'GLU', 'GL', 'X11', ]) -env.Prepend(LIBS = [glew]) -env.Program( +# Library specific environment settings +lib_env = env.Clone() + +lib_env.Append(CPPDEFINES = [ + 'GLEW_BUILD', + #'GLEW_MX', # Multiple Rendering Contexts support +]) + +if lib_env['platform'] == 'windows': + target = 'glew' +else: + target = 'GLEW' + +source = [ + 'glew.c', +] + +if lib_env['platform'] == 'windows': + glew = lib_env.SharedLibrary(target = target, source = source) + env.InstallSharedLibrary(glew, version=(1, 5, 2)) + glew = lib_env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX') +else: + # Use static library on Unices to avoid binary compatability issues + lib_env.Append(CPPDEFINES = ['GLEW_STATIC']) + glew = lib_env.StaticLibrary(target = target, source = source) + +# Program specific environment settings +prog_env = env.Clone() + +prog_env.Prepend(LIBS = [glew]) + +if prog_env['platform'] == 'darwin': + prog_env.Append(FRAMEWORKS = ['AGL']) + +prog_env.Program( target = 'glewinfo', source = ['glewinfo.c'], ) -env.Program( +prog_env.Program( target = 'visualinfo', source = ['visualinfo.c'], ) + +Export('glew')