summaryrefslogtreecommitdiff
path: root/src/mesa/SConscript
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-05-30 10:08:11 -0600
committerBrian Paul <brianp@vmware.com>2012-05-31 09:40:35 -0600
commitdff36e900c645401b26c9a44106459e96ee7a24d (patch)
tree7ca932a8752ad8bb7ab215d1d496aa696b8ceec8 /src/mesa/SConscript
parent185ed2105829d6f5eb19edb9abbf0d7977e157c3 (diff)
scons: add code to generate the various GL API files
This fixes recent build breakage when we began building the generated API files from xml as part of the normal build process. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
Diffstat (limited to 'src/mesa/SConscript')
-rw-r--r--src/mesa/SConscript15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index d7932c7c9ce..99bdfad46cd 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -6,6 +6,7 @@ Import('*')
import filecmp
import os
import subprocess
+from sys import executable as python_cmd
env = env.Clone()
@@ -328,8 +329,9 @@ mesa_sources = (
statetracker_sources
)
+GLAPI = '#src/mapi/glapi/'
+
if env['gles']:
- from sys import executable as python_cmd
env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1'])
@@ -349,7 +351,6 @@ if env['gles']:
)
# generate GLES headers
- GLAPI = '#src/mapi/glapi/'
gles_headers = []
gles_headers += env.CodeGenerate(
target = 'main/api_exec_es1_dispatch.h',
@@ -452,6 +453,16 @@ if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
env.Append(CPPPATH = [matypes[0].dir])
+# The enums.c file is generated from the GL/ES API.xml file
+env.CodeGenerate(
+ target = 'main/enums.c',
+ script = GLAPI + 'gen/gl_enums.py',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+
+# We also depend on the auto-generated GL API headers
+env.Depends(mesa_sources, glapi_headers)
def write_git_sha1_h_file(filename):