scons/android: add flag to check for enabled GL APIs
authorImre Deak <imre.deak@intel.com>
Wed, 12 Sep 2012 16:46:05 +0000 (19:46 +0300)
committerOliver McFadden <oliver.mcfadden@linux.intel.com>
Wed, 10 Oct 2012 09:43:16 +0000 (12:43 +0300)
Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
src/mesa/Android.mk
src/mesa/SConscript

index 4b62b8194b1faff9ee01c2ad4b8ac75d4d3b6295..c32b1c0c16fcd7509435f0e3ae883f3856f96d24 100644 (file)
@@ -33,9 +33,7 @@ LOCAL_PATH := $(call my-dir)
 #     X86_FILES
 include $(LOCAL_PATH)/sources.mak
 
-common_CFLAGS := \
-       -DFEATURE_ES1=1 \
-       -DFEATURE_ES2=1
+MESA_ENABLED_APIS := ES1 ES2
 
 common_C_INCLUDES := \
        $(MESA_TOP)/src/mapi \
@@ -100,9 +98,10 @@ include $(CLEAR_VARS)
 LOCAL_MODULE := libmesa_dricore
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
+MESA_ENABLED_APIS += GL
 LOCAL_CFLAGS := \
-       $(common_CFLAGS) \
-       -DFEATURE_GL=1
+   $(common_CFLAGS) \
+   $(patsubst %,-DFEATURE_%=1,$(MESA_ENABLED_APIS))
 
 LOCAL_C_INCLUDES := \
        $(common_C_INCLUDES)
index 9819082177f981f3874689d4585f3d025b113401..7d7d51930140017674d6734421787108b5a75ffe 100644 (file)
@@ -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 = [
@@ -335,7 +334,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 +367,8 @@ if env['gles']:
 
     mesa_sources += gles_sources
 
+env.Append(CPPDEFINES = ["FEATURE_%s=1" % api for api in enabled_apis])
+
 #
 # Assembly sources
 #