Remove unnecessary library dependencies

The vtkm_library macro was making all VTK-m libraries depend on all
other VTK-m libraries previously defined. This potentially creates
unnecessary linking. Instead, only depend on the backend libraries (like
TBB) and libraries explicitly given.
This commit is contained in:
Kenneth Moreland 2017-03-09 10:55:25 -05:00
parent 6fdc7eb8c0
commit 5355a432f3

@ -606,6 +606,7 @@ endfunction(vtkm_wrap_sources_for_cuda)
# [HEADERS <headers_list>]
# [CUDA]
# [WRAP_FOR_CUDA <source_list>]
# [LIBRARIES <dependent_library_list>]
# )
function(vtkm_library)
set(options CUDA)
@ -667,9 +668,11 @@ function(vtkm_library)
add_library(${lib_name} ${VTKm_LIB_SOURCES})
endif()
set(libs ${VTKm_LIBRARIES})
list(REMOVE_ITEM libs ${lib_name})
target_link_libraries(${lib_name} PUBLIC ${libs})
target_link_libraries(${lib_name} PUBLIC vtkm)
target_link_libraries(${lib_name} PRIVATE
${VTKm_BACKEND_LIBRARIES}
${VTKm_LIB_LIBRARIES}
)
set(cxx_args ${VTKm_COMPILE_OPTIONS})
separate_arguments(cxx_args)