cmake: Fix tests with BUILD_CXXLIBS or BUILD_PROGRAMS off

Fixes a regression introduced in 10797d5896
This commit is contained in:
Silent 2021-12-01 00:24:47 +01:00 committed by Martijn van Beurden
parent 6debf337c8
commit 179cdce1db

View File

@ -6,15 +6,19 @@ if(NOT UNIX)
add_test(NAME libFLAC
COMMAND $<TARGET_FILE:test_libFLAC>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME libFLAC++
COMMAND $<TARGET_FILE:test_libFLAC++>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME flac_help
COMMAND $<TARGET_FILE:flacapp> --help
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME metaflac_help
COMMAND $<TARGET_FILE:metaflac> --help
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
if(BUILD_CXXLIBS)
add_test(NAME libFLAC++
COMMAND $<TARGET_FILE:test_libFLAC++>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
if(BUILD_PROGRAMS)
add_test(NAME flac_help
COMMAND $<TARGET_FILE:flacapp> --help
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME metaflac_help
COMMAND $<TARGET_FILE:metaflac> --help
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
return()
endif()