mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 18:06:25 +08:00
add facility to link libraries to tests (#1850)
This commit is contained in:
committed by
Robert Nishihara
parent
834e594709
commit
3039cca242
@@ -226,3 +226,13 @@ function(ADD_RAY_TEST REL_TEST_NAME)
|
||||
endif()
|
||||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "unittest")
|
||||
endfunction()
|
||||
|
||||
# A wrapper for target_link_libraries() that is compatible with NO_TESTS.
|
||||
function(RAY_TEST_LINK_LIBRARIES REL_TEST_NAME)
|
||||
if(NO_TESTS)
|
||||
return()
|
||||
endif()
|
||||
get_filename_component(TEST_NAME ${REL_TEST_NAME} NAME_WE)
|
||||
|
||||
target_link_libraries(${TEST_NAME} ${ARGN})
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user