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.
develop
Tim Siegel 2022-04-21 10:42:19 -04:00 committed by Josh Cooper
parent c5be87e381
commit face558dd0
1 changed files with 4 additions and 6 deletions

@ -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)