Commit bb3916c3 authored by Chad Versace's avatar Chad Versace Committed by Paul Berry

cmake: Make each *.o depend on generated piglit_dispatch headers

Alter the wrapper functions `piglit_add_executable` and
`piglit_add_library` to add to each object file a dependency on
piglit_dispatch's generated files. This requires that a top-level custom
target be created, `piglit_dispatch_gen`, to track that dependency.

The result is that updating any files in `piglit_dispatch_gen_inputs` (for
example, gl_API.xml) triggers a recompile of all objects.
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent ba75b97a
......@@ -49,27 +49,33 @@ function(piglit_include_target_api)
endfunction(piglit_include_target_api)
#
# For now, this is a trivial wrapper around `add_executable`.
# function piglit_add_executable
#
# In the future, it will be used to add to each object file an explicit
# dependency on the header files generated by piglit_dispatch.
# This function wraps `add_executable` and has the same signature.
#
# In addition to calling `add_executable`, it adds to each object file
# a dependency on piglit_dispatch's generated files.
#
function(piglit_add_executable name)
list(REMOVE_AT ARGV 0)
add_executable(${name} ${ARGV})
add_dependencies(${name} piglit_dispatch_gen)
endfunction(piglit_add_executable)
#
# For now, this is a trivial wrapper around `add_library`.
# function piglit_add_library
#
# This function wraps `add_library` and has the same signature.
#
# In the future, it will be used to add to each object file an explicit
# dependency on the header files generated by piglit_dispatch.
# In addition to calling `add_library`, it adds to each object file
# a dependency on piglit_dispatch's generated files.
#
function(piglit_add_library name)
list(REMOVE_AT ARGV 0)
add_library(${name} ${ARGV})
add_dependencies(${name} piglit_dispatch_gen)
endfunction(piglit_add_library)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment