mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-07 05:53:59 -07:00
fix(cmake): guard filter_string_test behind WITH_ORACLE or WITH_CLIENT. filter_string_test links against libcockatrice_filters, which is only built when WITH_ORACLE or WITH_CLIENT is enabled. Without this guard, test-only builds fail at configure time because the target doesn't exist. The guard condition mirrors the one in the root CMakeLists.txt that controls whether libcockatrice_filters is built.
This commit is contained in:
parent
8180d2e3b0
commit
4493a3f259
1 changed files with 16 additions and 10 deletions
|
|
@ -30,23 +30,29 @@ add_test(NAME carddatabase_test COMMAND carddatabase_test)
|
|||
|
||||
# ------------------------
|
||||
# Filter String Test
|
||||
# (guard must match the condition for libcockatrice_filters in the root CMakeLists.txt)
|
||||
# ------------------------
|
||||
add_executable(filter_string_test ${MOCKS_SOURCES} ${VERSION_STRING_CPP} filter_string_test.cpp mocks.cpp)
|
||||
if(WITH_ORACLE OR WITH_CLIENT)
|
||||
add_executable(filter_string_test ${MOCKS_SOURCES} ${VERSION_STRING_CPP} filter_string_test.cpp mocks.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
filter_string_test
|
||||
PRIVATE libcockatrice_filters
|
||||
PRIVATE Threads::Threads
|
||||
PRIVATE ${GTEST_BOTH_LIBRARIES}
|
||||
PRIVATE ${TEST_QT_MODULES}
|
||||
)
|
||||
target_link_libraries(
|
||||
filter_string_test
|
||||
PRIVATE libcockatrice_filters
|
||||
PRIVATE Threads::Threads
|
||||
PRIVATE ${GTEST_BOTH_LIBRARIES}
|
||||
PRIVATE ${TEST_QT_MODULES}
|
||||
)
|
||||
|
||||
add_test(NAME filter_string_test COMMAND filter_string_test)
|
||||
add_test(NAME filter_string_test COMMAND filter_string_test)
|
||||
|
||||
if(NOT GTEST_FOUND)
|
||||
add_dependencies(filter_string_test gtest)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ------------------------
|
||||
# Dependencies on gtest
|
||||
# ------------------------
|
||||
if(NOT GTEST_FOUND)
|
||||
add_dependencies(carddatabase_test gtest)
|
||||
add_dependencies(filter_string_test gtest)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue