summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-02-21 18:42:05 -0800
committerPaul Berry <stereotype441@gmail.com>2012-03-23 13:39:57 -0700
commitbb3916c32944115f8374aff23e20e85820814d33 (patch)
tree718143d36580f95bc9485234e51937f59aacf83a
parentba75b97a7d19c2d154c45cd3e065735db4a3cca5 (diff)
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: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--cmake/piglit_util.cmake18
1 files changed, 12 insertions, 6 deletions
diff --git a/cmake/piglit_util.cmake b/cmake/piglit_util.cmake
index 68c72888..0daaad2c 100644
--- a/cmake/piglit_util.cmake
+++ b/cmake/piglit_util.cmake
@@ -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)