From 1235f05af70c3acea7eedb0cbfd726ab4ec357c4 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 20 Feb 2023 00:33:42 +0000 Subject: [PATCH] Make the HAVE_HF_ITER define target-specific Leaking HAVE_HF_ITER into the entire build just because fuzzpuzz wanted it was ugly, and also this needs fewer lines of CMake code. --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7bab9b..0937d25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,11 +279,8 @@ if(build_cli_programs) write_generated_games_header() include(CheckFunctionExists) check_function_exists(HF_ITER HAVE_HF_ITER) - if(HAVE_HF_ITER) - add_definitions(-DHAVE_HF_ITER) - endif() cliprogram(fuzzpuzz fuzzpuzz.c list.c ${puzzle_sources} - COMPILE_DEFINITIONS COMBINED) + COMPILE_DEFINITIONS COMBINED $<$:HAVE_HF_ITER>) target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir}) endif()