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.
This commit is contained in:
Ben Harris
2023-02-20 00:33:42 +00:00
parent 1880feb442
commit 1235f05af7

View File

@ -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 $<$<BOOL:${HAVE_HF_ITER}>:HAVE_HF_ITER>)
target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir})
endif()