diff options
Diffstat (limited to 'mesalib/src/mesa/SConscript')
-rw-r--r-- | mesalib/src/mesa/SConscript | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index 981908217..b7f908a9a 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -16,9 +16,8 @@ env.Append(CPPPATH = [ '#/src/mesa', ]) -env.Append(CPPDEFINES = [ - 'FEATURE_GL=1', -]) +enabled_apis = [] +enabled_apis += ['GL'] if env['platform'] == 'windows': env.Append(CPPDEFINES = [ @@ -78,7 +77,6 @@ main_sources = [ 'main/format_pack.c', 'main/format_unpack.c', 'main/framebuffer.c', - 'main/get.c', 'main/getstring.c', 'main/glformats.c', 'main/hash.c', @@ -141,6 +139,10 @@ main_sources = [ 'main/vtxfmt.c', ] +glget_sources = [ + 'main/get.c', +] + math_sources = [ 'math/m_debug_clip.c', 'math/m_debug_norm.c', @@ -321,6 +323,7 @@ common_driver_sources = [ mesa_sources = ( main_sources + + glget_sources + math_sources + program_sources + vbo_sources + @@ -335,7 +338,7 @@ GLAPI = '#src/mapi/glapi/' if env['gles']: - env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1']) + enabled_apis += ['ES1', 'ES2'] # generate GLES sources gles_sources = ['main/es1_conversion.c',] @@ -368,6 +371,20 @@ if env['gles']: mesa_sources += gles_sources +env.Append(CPPDEFINES = ["FEATURE_%s=1" % api for api in enabled_apis]) + +get_hash_gen_opts = ' '.join(["-a %s" % api for api in enabled_apis]) + +get_hash_header = env.CodeGenerate( + target = 'main/get_hash.h', + script = 'main/get_hash_generator.py', + source = GLAPI + 'gen/gl_and_es_API.xml', + command = python_cmd + ' $SCRIPT ' + get_hash_gen_opts + + ' -f $SOURCE > $TARGET' +) + +env.Depends(glget_sources, get_hash_header) + # # Assembly sources # |