Commit 2a8f7ec4 authored by Robert Maynard's avatar Robert Maynard

Fix more build system issues with separable compilation

parent 7c27bedc
......@@ -465,7 +465,14 @@ function(vtkm_unit_tests)
set_property(TARGET ${test_prog} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH})
set_property(TARGET ${test_prog} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH})
target_link_libraries(${test_prog} PRIVATE vtkm_cont ${VTKm_UT_LIBRARIES})
#Starting in CMake 3.13, cmake will properly drop duplicate libraries
#from the link line so this workaround can be dropped
if (CMAKE_VERSION VERSION_LESS 3.13 AND "vtkm_rendering" IN_LIST VTKm_UT_LIBRARIES)
list(REMOVE_ITEM VTKm_UT_LIBRARIES "vtkm_cont")
target_link_libraries(${test_prog} PRIVATE ${VTKm_UT_LIBRARIES})
else()
target_link_libraries(${test_prog} PRIVATE vtkm_cont ${VTKm_UT_LIBRARIES})
endif()
foreach(current_backend ${all_backends})
set (device_command_line_argument --device=${current_backend})
......
......@@ -17,7 +17,7 @@
## Laboratory (LANL), the U.S. Government retains certain rights in
## this software.
##============================================================================
function(add_benchmark name files)
function(add_benchmark name files lib)
set(benchmarks )
add_executable(${name}_SERIAL ${files})
......@@ -49,7 +49,7 @@ function(add_benchmark name files)
endif()
foreach(benchmark ${benchmarks})
target_link_libraries(${benchmark} PRIVATE vtkm_cont)
target_link_libraries(${benchmark} PRIVATE ${lib})
set_target_properties(${benchmark} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH}
)
......@@ -69,19 +69,9 @@ set(benchmarks
)
foreach (benchmark ${benchmarks})
add_benchmark(${benchmark} ${benchmark}.cxx)
add_benchmark(${benchmark} ${benchmark}.cxx vtkm_cont)
endforeach ()
if(TARGET vtkm_rendering)
add_benchmark(BenchmarkRayTracing BenchmarkRayTracing.cxx)
target_link_libraries(BenchmarkRayTracing_SERIAL PRIVATE vtkm_rendering)
if(TARGET BenchmarkRayTracing_TBB)
target_link_libraries(BenchmarkRayTracing_TBB PRIVATE vtkm_rendering)
endif()
if(TARGET BenchmarkRayTracing_OPENMP)
target_link_libraries(BenchmarkRayTracing_OPENMP PRIVATE vtkm_rendering)
endif()
if(TARGET BenchmarkRayTracing_CUDA)
target_link_libraries(BenchmarkRayTracing_CUDA PRIVATE vtkm_rendering)
endif()
add_benchmark(BenchmarkRayTracing BenchmarkRayTracing.cxx vtkm_rendering)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment