path: root/CMakeLists.txt
diff options
authorPaul Berry <stereotype441@gmail.com>2012-03-01 16:38:26 -0800
committerPaul Berry <stereotype441@gmail.com>2012-03-23 13:36:35 -0700
commit6fe17bb7ce5eab80334249aa8a57f7b948fad318 (patch)
treed19bf5d0407a8cfaaf5663d6d0201f64d73cf50b /CMakeLists.txt
parent6409a675112a31e26cae70d86989f7d098629576 (diff)
piglit-dispatch: Code generation scripts.
This patch contains the code generation scripts that convert the files gl.spec, gl.tm, and enumext.spec into C code, as well as the CMake directives to run the scripts. Code generation occurs in two phases: first the script glapi/parse_glspec.py converts the .spec and .tm files into an intermediate JSON format, which is stored in glapi/glapi.json. Then, the script tests/util/gen_dispatch.py converts the JSON file into two files, tests/util/generated_dispatch.c and tests/util/generated_dispatch.h. There are two motivations for breaking code generation into two phases: (1) there are other code generation tasks we may add in the future (e.g. generating the tests/util/piglit-util-enum.c file), and it would be nice not to have to rewrite any parsing code when we do so. (2) if the GL consortium ever decides to change the format of gl.spec, gl.tm, and enumext.spec, then we only have to change parse_glspec.py. These code generation scripts can be run by invoking "make piglit_dispatch_gen" from the toplevel source directory. v2: Add clarifying comments, remove a bogus "print" statement, and raise an exception if an unrecognized multiplicity is encountered. Also, handle "reference" multiplicity. v3: Add APIENTRY to stub functions. Rename "near" and "far" to avoid problems on MSVC. Get rid of "__" in function names. Rename initialize_dispatch_pointers => reset_dispatch_pointers. Add gl_10x_version parameter to get_core_proc(). Output generated code relative to CMAKE_BINARY_DIR so that it won't pollute source directories when building out of tree. Add .gitignore so that generated files are ignored when building in tree. Add GL_VERSION_* defines.
Diffstat (limited to 'CMakeLists.txt')
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d7bf35b..5d814d2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,6 +169,9 @@ configure_file(