Skip to content

Commit

Permalink
add facility to link libraries to tests (ray-project#1850)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmoritz authored and robertnishihara committed Apr 10, 2018
1 parent 834e594 commit 3039cca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/Modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 3039cca

Please sign in to comment.