From face558dd060161de5e8a9f6301e4876d572a087 Mon Sep 17 00:00:00 2001 From: Tim Siegel Date: Thu, 21 Apr 2022 10:42:19 -0400 Subject: [PATCH] unit testing: Link test executables against libdfhack Note: Hard-coded "SDL" here is wrong, but requires some refactoring in top-level CMakeLists.txt to fix. --- library/CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 640d17978..dd9582b5b 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -84,12 +84,10 @@ set(MAIN_SOURCES if(BUILD_TESTS) # TODO Make a function or macro for this - add_executable( - MiscUtils.test - MiscUtils.test.cpp - MiscUtils.cpp) - add_test(NAME MiscUtils.test - COMMAND MiscUtils.test) + add_executable(MiscUtils.test MiscUtils.test.cpp) + # FIXME Hard-coded "SDL" works on Linux, but probably isn't portable + target_link_libraries(MiscUtils.test dfhack SDL) + add_test(NAME MiscUtils.test COMMAND MiscUtils.test) endif() if(WIN32)