From d0f97926e80482d9cbb3679165a09ca6e695f83f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 5 May 2023 12:51:25 +0100 Subject: [PATCH] Isolate icons build from the running user's preferences. Preferences that adjust the display, such as Pearl graphics style or Light Up lit-blobs toggling, shouldn't affect the official icons, even if a ~/.config/sgt-puzzles exists in the account that builds the puzzles. --- icons/icons.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/icons/icons.cmake b/icons/icons.cmake index 2795a29..2c4902b 100644 --- a/icons/icons.cmake +++ b/icons/icons.cmake @@ -97,6 +97,10 @@ set(border_16 1) set(icon_srcdir ${CMAKE_SOURCE_DIR}/icons) set(icon_bindir ${CMAKE_BINARY_DIR}/icons) +# We'll need to point $SGT_PUZZLES_DIR at an empty directory, to avoid +# the icons reflecting the building user's display preferences. +set(empty_config_dir ${CMAKE_BINARY_DIR}/icons/config) + function(build_icon name) set(output_icon_files) @@ -118,7 +122,10 @@ function(build_icon name) set(redo_arg) endif() add_custom_command(OUTPUT ${icon_bindir}/${name}-base.png - COMMAND ${CMAKE_COMMAND} -E env ASAN_OPTIONS=detect_leaks=0 + COMMAND ${CMAKE_COMMAND} -E make_directory ${empty_config_dir} + COMMAND ${CMAKE_COMMAND} -E env + ASAN_OPTIONS=detect_leaks=0 + SGT_PUZZLES_DIR=${empty_config_dir} ${icon_bindir}/${name}-icon-maker ${redo_arg} --screenshot ${icon_bindir}/${name}-base.png