fix: do not test utils if not building utils (#4946)

Setting `-DENABLE_UTILS=0 -DENABLE_TESTS=1` causes CMake errors due to
tests/utils/CMakeLists.txt referencing
`$<TARGET_FILE:transmission-show>` which is undefined.  Fixed by
including the tests/utils/ directory only if `ENABLE_UTILS` is true.
This commit is contained in:
fghzxm 2023-02-21 13:43:05 +08:00 committed by GitHub
parent 3c9d997f47
commit db118e7998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
add_subdirectory(gtest)
add_subdirectory(libtransmission)
add_subdirectory(utils)
if(ENABLE_UTILS)
add_subdirectory(utils)
endif()