summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2011-08-10 10:32:56 -0700
committerPaul Berry <stereotype441@gmail.com>2011-08-10 10:53:30 -0700
commit1e77364946e50d087a09ef588f8b90b502019838 (patch)
tree3b05ff271c5e10a2c482470ae483d24019cca39c
parentc8bb64613c8112cc2ac89e5984da6c1f204c3b36 (diff)
Fix autogeneration of builtin uniform tests on Windows.
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
-rw-r--r--generated_tests/.gitignore1
-rw-r--r--generated_tests/CMakeLists.txt24
2 files changed, 7 insertions, 18 deletions
diff --git a/generated_tests/.gitignore b/generated_tests/.gitignore
index 79c6997b..2885c151 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 e3ff3860..75b3d8ee 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)