aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-02-20 00:33:42 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-02-20 00:33:42 +0000
commit1235f05af70c3acea7eedb0cbfd726ab4ec357c4 (patch)
treebd34b43ef8928cc260f4a79d16f33f9c9e25f29c
parent1880feb442c4b2d73137b02c8dc58f8d38f4e16a (diff)
downloadpuzzles-1235f05af70c3acea7eedb0cbfd726ab4ec357c4.zip
puzzles-1235f05af70c3acea7eedb0cbfd726ab4ec357c4.tar.gz
puzzles-1235f05af70c3acea7eedb0cbfd726ab4ec357c4.tar.bz2
puzzles-1235f05af70c3acea7eedb0cbfd726ab4ec357c4.tar.xz
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.
-rw-r--r--CMakeLists.txt5
1 files changed, 1 insertions, 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 $<$<BOOL:${HAVE_HF_ITER}>:HAVE_HF_ITER>)
target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir})
endif()