Always install all device headers even when device isn't enabled.

vtkm_declare_headers now is able to not test headers, by using the
TESTABLE keyword.
This commit is contained in:
Robert Maynard 2015-09-17 09:23:53 -04:00
parent b1663b24b7
commit fd68521066
9 changed files with 39 additions and 38 deletions

@ -153,17 +153,26 @@ endfunction(vtkm_requires_thrust_to_test)
# compiled and show up in an IDE.
function(vtkm_declare_headers)
set(options CUDA)
set(oneValueArgs)
set(oneValueArgs TESTABLE)
set(multiValueArgs)
cmake_parse_arguments(VTKm_DH "${options}"
"${oneValueArgs}" "${multiValueArgs}"
${ARGN}
)
#The testable keyword allows the caller to turn off the header testing,
#mainly used so that backends can be installed even when they can't be
#built on the machine.
#Since this is an optional property not setting it means you do want testing
if(NOT DEFINED VTKm_DH_TESTABLE)
set(VTKm_DH_TESTABLE ON)
endif()
set(hfiles ${VTKm_DH_UNPARSED_ARGUMENTS})
vtkm_get_kit_name(name dir_prefix)
#only do header testing if enable testing is turned on
if (VTKm_ENABLE_TESTING)
if (VTKm_ENABLE_TESTING AND VTKm_DH_TESTABLE)
vtkm_add_header_build_test(
"${name}" "${dir_prefix}" "${VTKm_DH_CUDA}" ${hfiles})
endif()

@ -68,12 +68,8 @@ add_subdirectory(arg)
vtkm_declare_headers(${impl_headers} ${headers})
if (VTKm_ENABLE_CUDA)
add_subdirectory(cuda)
endif ()
if (VTKm_ENABLE_TBB)
add_subdirectory(tbb)
endif ()
add_subdirectory(cuda)
add_subdirectory(tbb)
#-----------------------------------------------------------------------------
add_subdirectory(testing)

@ -23,14 +23,18 @@ set(headers
DeviceAdapterCuda.h
)
vtkm_disable_troublesome_thrust_warnings()
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_CUDA)
vtkm_disable_troublesome_thrust_warnings()
CUDA_INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
endif()
#-----------------------------------------------------------------------------
CUDA_INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
add_subdirectory(internal)
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})
#-----------------------------------------------------------------------------
vtkm_declare_headers(CUDA ${headers})
if (VTKm_ENABLE_CUDA)
add_subdirectory(testing)
endif()
add_subdirectory(testing)

@ -28,6 +28,9 @@ set(headers
ThrustExceptionHandler.h
)
vtkm_declare_headers(CUDA ${headers})
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})
add_subdirectory(testing)
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_CUDA)
add_subdirectory(testing)
endif()

@ -24,6 +24,9 @@ set(headers
add_subdirectory(internal)
vtkm_declare_headers(${headers})
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_TBB})
add_subdirectory(testing)
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_TBB)
add_subdirectory(testing)
endif()

@ -31,4 +31,4 @@ if("${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" VERSION_LESS 4.3)
set(headers ${headers} parallel_sort.h)
endif()
vtkm_declare_headers(${headers})
vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_TBB})

@ -39,9 +39,7 @@ vtkm_declare_headers(${impl_headers} ${headers})
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_CUDA)
add_subdirectory(cuda)
endif ()
add_subdirectory(cuda)
#-----------------------------------------------------------------------------

@ -18,14 +18,5 @@
## this software.
##============================================================================
set(headers
)
#-----------------------------------------------------------------------------
add_subdirectory(internal)
# vtkm_declare_headers(${impl_headers} ${headers})
#-----------------------------------------------------------------------------
# add_subdirectory(testing)

@ -24,13 +24,10 @@ set(headers
WrappedOperators.h
)
vtkm_disable_troublesome_thrust_warnings()
#-----------------------------------------------------------------------------
CUDA_INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
if (VTKm_ENABLE_CUDA)
vtkm_disable_troublesome_thrust_warnings()
CUDA_INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
endif()
vtkm_declare_headers(CUDA ${headers})
#-----------------------------------------------------------------------------
# add_subdirectory(testing)
vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA})