1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00
transmission/tests/libtransmission/CMakeLists.txt
Charles Kerr 35fe175f2a
refactor: add file-piece-map (#2246)
* refactor: add file-piece-map

* refactor: use tr_file_priorities

* refactor: use tr_files_wanted
2021-11-28 19:12:54 -06:00

84 lines
2 KiB
CMake

add_executable(libtransmission-test
bitfield-test.cc
block-info-test.cc
blocklist-test.cc
clients-test.cc
completion-test.cc
copy-test.cc
crypto-test-ref.h
crypto-test.cc
error-test.cc
file-test.cc
file-piece-map-test.cc
getopt-test.cc
history-test.cc
json-test.cc
magnet-metainfo-test.cc
makemeta-test.cc
metainfo-test.cc
move-test.cc
peer-mgr-active-requests-test.cc
peer-mgr-wishlist-test.cc
peer-msgs-test.cc
quark-test.cc
rename-test.cc
rpc-test.cc
session-test.cc
subprocess-test-script.cmd
subprocess-test.cc
test-fixtures.h
utils-test.cc
variant-test.cc
watchdir-test.cc
web-utils-test.cc)
target_compile_definitions(libtransmission-test
PRIVATE
-DLIBTRANSMISSION_TEST_ASSETS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/assets"
__TRANSMISSION__)
target_include_directories(libtransmission-test
PRIVATE
${CMAKE_SOURCE_DIR}/libtransmission
${CMAKE_BINARY_DIR}/libtransmission)
target_include_directories(libtransmission-test SYSTEM
PRIVATE
${CURL_INCLUDE_DIRS}
${EVENT2_INCLUDE_DIRS})
target_compile_options(libtransmission-test
PRIVATE
${CXX_WARNING_FLAGS}
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>:-Wno-sign-compare>) # patches welcomed
target_link_libraries(libtransmission-test
PRIVATE
${TR_NAME}
gtestall)
add_test(
NAME libtransmission-test
COMMAND libtransmission-test)
add_custom_command(
TARGET libtransmission-test
PRE_BUILD
COMMAND
${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/subprocess-test-script.cmd
$<TARGET_FILE_DIR:libtransmission-test>/subprocess-test.cmd)
add_executable(subprocess-test
subprocess-test-program.cc)
target_include_directories(subprocess-test
PRIVATE
${CMAKE_SOURCE_DIR}/libtransmission)
target_link_libraries(subprocess-test
PRIVATE
${TR_NAME})
add_dependencies(libtransmission-test
subprocess-test)