shithub: puzzles

Download patch

ref: 1880feb442c4b2d73137b02c8dc58f8d38f4e16a
parent: 1470c9530b1cff33d11170b9b891d94be62c4194
author: Ben Harris <[email protected]>
date: Sun Feb 19 19:28:42 EST 2023

Support multiple COMPILE_DEFINITIONS for a program

Despite the name, COMPILE_DEFINITIONS was only ever used to set a
single definition, and as far as I can tell that's all it could do
even when I tried to put them in a single word separated by
semicolons.  Turning COMPILE_DEFINITIONS into a multi-valued argument
seems to make it work much better.

--- a/cmake/setup.cmake
+++ b/cmake/setup.cmake
@@ -115,7 +115,7 @@
 # a command-line helper tool.
 function(cliprogram NAME)
   cmake_parse_arguments(OPT
-    "" "COMPILE_DEFINITIONS" "" ${ARGN})
+    "" "" "COMPILE_DEFINITIONS" ${ARGN})
 
   if(build_cli_programs)
     add_executable(${NAME} ${CMAKE_SOURCE_DIR}/nullfe.c
@@ -131,7 +131,7 @@
 # the normal puzzle frontend.
 function(guiprogram NAME)
   cmake_parse_arguments(OPT
-    "" "COMPILE_DEFINITIONS" "" ${ARGN})
+    "" "" "COMPILE_DEFINITIONS" ${ARGN})
 
   if(build_gui_programs)
     get_platform_puzzle_extra_source_files(extra_files ${NAME})