[Piglit] [PATCH] Fix autogeneration of builtin uniform tests on Windows.

Paul Berry stereotype441 at gmail.com
Wed Aug 10 11:59:10 PDT 2011


This patch modifies the invocation of CMake's add_custom_command()
function so that instead of specifying all 462 output files
explicitly, it instead specifies a single file,
builtin_uniform_tests.list, which receives a list of all the files
generated.

It is safe not to specify the individual output files since there are
no other build steps that depend on them, so there is no danger of the
build step happening at the wrong time.

This prevents CMake from trying to output an outrageously long
diagnostic message listing all the files generated by the custom
command, a message that was too long to work with the NMake back-end
used on Windows.

Bugzilla:https://bugs.freedesktop.org/show_bug.cgi?id=39873
---
 generated_tests/.gitignore     |    1 +
 generated_tests/CMakeLists.txt |   24 ++++++------------------
 2 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/generated_tests/.gitignore b/generated_tests/.gitignore
index 79c6997..2885c15 100644
--- a/generated_tests/.gitignore
+++ b/generated_tests/.gitignore
@@ -1 +1,2 @@
 spec
+*.list
diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index e3ff386..75b3d8e 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -1,24 +1,12 @@
-# Execute gen_builtin_uniform_tests.py once during configure to find
-# out what files it generates.
-set(gen_builtin_uniform
-	${CMAKE_CURRENT_SOURCE_DIR}/gen_builtin_uniform_tests.py)
-execute_process(
-	COMMAND ${python} ${gen_builtin_uniform} --names-only
-        OUTPUT_VARIABLE builtin_uniform_tests
-	RESULT_VARIABLE builtin_uniform_tests_result)
-if(NOT builtin_uniform_tests_result EQUAL 0)
-	message(FATAL_ERROR "gen_builtin_uniform_tests.py failed")
-endif(NOT builtin_uniform_tests_result EQUAL 0)
-string(REPLACE "\n" ";" builtin_uniform_tests ${builtin_uniform_tests})
-
 # Add a custom command which executes gen_builtin_uniform_tests.py
 # during the build.
-add_custom_command(OUTPUT ${builtin_uniform_tests}
-	COMMAND ${python} ${gen_builtin_uniform}
+add_custom_command(
+	OUTPUT builtin_uniform_tests.list
+	COMMAND ${python} ${CMAKE_CURRENT_SOURCE_DIR}/gen_builtin_uniform_tests.py > builtin_uniform_tests.list
 	DEPENDS gen_builtin_uniform_tests.py builtin_function.py
 	VERBATIM)
 
-# And add a "gen-tests" target that can be used to generate all the
-# tests without doing any other compilation.
+# Add a "gen-tests" target that can be used to generate all the tests
+# without doing any other compilation.
 add_custom_target(gen-tests ALL
-	DEPENDS ${builtin_uniform_tests})
+	DEPENDS builtin_uniform_tests.list)
-- 
1.7.6



More information about the Piglit mailing list