aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xbenchmark.sh8
-rw-r--r--cmake/setup.cmake12
3 files changed, 19 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b103a3..9e8d96f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -275,4 +275,4 @@ cliprogram(penrose-vector-test penrose.c COMPILE_DEFINITIONS TEST_VECTORS)
cliprogram(sort-test sort.c COMPILE_DEFINITIONS SORT_TEST)
cliprogram(tree234-test tree234.c COMPILE_DEFINITIONS TEST)
-build_platform_extras()
+build_extras()
diff --git a/benchmark.sh b/benchmark.sh
index b3af277..3e24491 100755
--- a/benchmark.sh
+++ b/benchmark.sh
@@ -2,11 +2,15 @@
# Run every puzzle in benchmarking mode, and generate a file of raw
# data that benchmark.pl will format into a web page.
+#
+# Expects to be run in the cmake build directory, where it can find
+# both the game binaries themselves and the file gamelist.txt that
+# lists them.
# If any arguments are provided, use those as the list of games to
-# benchmark. Otherwise, read the full list from gamedesc.txt.
+# benchmark. Otherwise, read the full list from gamelist.txt.
if test $# = 0; then
- set -- $(cut -f1 -d: < gamedesc.txt)
+ set -- $(cat gamelist.txt)
fi
failures=false
diff --git a/cmake/setup.cmake b/cmake/setup.cmake
index 26eb74d..ee39dbf 100644
--- a/cmake/setup.cmake
+++ b/cmake/setup.cmake
@@ -160,3 +160,15 @@ macro(export_variables_to_parent_scope)
set(objective_${name} ${objective_${name}} PARENT_SCOPE)
endforeach()
endmacro()
+
+macro(build_extras)
+ # Write out a list of the game names, for benchmark.sh to use.
+ file(WRITE ${CMAKE_BINARY_DIR}/gamelist.txt "")
+ list(SORT puzzle_names)
+ foreach(name ${puzzle_names})
+ file(APPEND ${CMAKE_BINARY_DIR}/gamelist.txt "${name}\n")
+ endforeach()
+
+ # Further extra stuff specific to particular platforms.
+ build_platform_extras()
+endmacro()