xgl-generate: do not hardcode #include's

Add core_headers to xgl.py and use it to generate #include's
This commit is contained in:
Chia-I Wu 2014-09-13 13:36:06 +08:00
parent c38bc685fd
commit 5c24a8e051
2 changed files with 6 additions and 15 deletions

View File

@ -33,9 +33,11 @@ class Subcommand(object):
def __init__(self, argv):
self.argv = argv
self.protos = ()
self.headers = ()
def run(self):
self.protos = xgl.core
self.headers = xgl.core_headers
print(self.generate())
def generate(self):
@ -84,7 +86,7 @@ class Subcommand(object):
*/"""
def generate_header(self):
pass
return "\n".join(["#include <" + h + ">" for h in self.headers])
def generate_body(self):
pass
@ -140,20 +142,6 @@ class LoaderSubcommand(Subcommand):
return "\n\n".join(body)
class IcdDispatchTableSubcommand(Subcommand):
def generate_header(self):
return "\n".join([
"#include <xgl.h>",
"#include <xglDbg.h>"])
def generate_body(self):
return self._generate_icd_dispatch_table()
class IcdDispatchTableSubcommand(Subcommand):
def generate_header(self):
return "\n".join([
"#include <xgl.h>",
"#include <xglDbg.h>"])
def generate_body(self):
return self._generate_icd_dispatch_table()

3
xgl.py
View File

@ -696,8 +696,11 @@ core = (
(Param("XGL_CMD_BUFFER", "cmdBuffer"))),
)
core_headers = ("xgl.h", "xglDbg.h")
# the dispatch table defined for ICDs
# XXX figure out the real order
# XXX this is not extensible
icd_dispatch_table = (
"InitAndEnumerateGpus",
"GetGpuInfo",