mesa: add EXT_dsa glGetVertexArray* 4 functions
[mesa.git] / src / mapi / glapi / SConscript
index 79cbb6a40d1f5aef83c62efc37d6b39e9ac2d370..a086f435efc12b5d0cb822787955b2143d78ab97 100644 (file)
@@ -8,6 +8,8 @@ Import('*')
 
 env = env.Clone()
 
+env.MSVC2013Compat()
+
 env.Append(CPPDEFINES = [
     'MAPI_MODE_UTIL',
 ])
@@ -16,17 +18,16 @@ if env['platform'] == 'windows':
     env.Append(CPPDEFINES = [
         '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
         'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
+        'KHRONOS_DLL_EXPORTS', # declare gl* as __declspec(dllexport) in Khronos headers
+        '_GLAPI_NO_EXPORTS', # prevent _glapi_* from being declared __declspec(dllimport)
     ])
-    if env['gles']:
-        env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
-    else:
-        # prevent _glapi_* from being declared __declspec(dllimport)
-        env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
 
 env.Append(CPPPATH = [
+    '#/src',
     '#/src/mapi',
     '#/src/mesa',
-    Dir('..'), # src/mapi build path
+    Dir('.'), # src/mapi/glapi build path
+    Dir('gen'), # src/mapi/glapi/gen build path
 ])
 
 glapi_sources = [
@@ -34,7 +35,6 @@ glapi_sources = [
     'glapi_entrypoint.c',
     'glapi_getproc.c',
     'glapi_nop.c',
-    'glthread.c',
     'glapi.c',
 ]
 
@@ -49,8 +49,9 @@ for s in mapi_sources:
 #
 # Assembly sources
 #
-if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
+if env['platform'] not in ('cygwin', 'darwin', 'windows'):
     GLAPI = '#src/mapi/glapi/'
+    sources = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
 
     if env['machine'] == 'x86':
         env.Append(CPPDEFINES = [
@@ -62,7 +63,7 @@ if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
         env.CodeGenerate(
             target = 'glapi_x86.S',
             script = GLAPI + 'gen/gl_x86_asm.py',
-            source = GLAPI + 'gen/gl_and_es_API.xml',
+            source = sources,
             command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
             )
     elif env['machine'] == 'x86_64':
@@ -75,7 +76,7 @@ if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
         env.CodeGenerate(
             target = 'glapi_x86-64.S',
             script = GLAPI + 'gen/gl_x86-64_asm.py',
-            source = GLAPI + 'gen/gl_and_es_API.xml',
+            source = sources,
             command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
             )
     elif env['machine'] == 'sparc':
@@ -88,17 +89,12 @@ if env['gcc'] and env['platform'] not in ('cygwin', 'darwin', 'windows'):
         env.CodeGenerate(
             target = 'glapi_sparc.S',
             script = GLAPI + 'gen/gl_SPARC_asm.py',
-            source = GLAPI + 'gen/gl_and_es_API.xml',
+            source = sources,
             command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
             )
     else:
         pass
 
-if env['toolchain'] == 'crossmingw':
-    # compile these files without -gstabs option
-    glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_dispatch.c")
-    glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_getproc.c")
-
 glapi = env.ConvenienceLibrary(
     target = 'glapi',
     source = glapi_sources,