From 4ec5bae02d93ea7f8c2d7e1fa88d7369bb4bed98 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 16 Jan 2019 10:04:33 -0600 Subject: [PATCH] Remove VTK-m TestBuild infrastructure The purpose of the TestBuild infrastructure was to confirm that VTK-m didn't have any lexical issues when it was a pure header only project. As we now move to have more compiled components the need for this form of testing is mitigated. Combined with the issue of TestBuilds causing MSVC issues, we should just remove this infrastructure. --- CMake/VTKmWrappers.cmake | 105 +----------------- vtkm/CMakeLists.txt | 2 - vtkm/cont/cuda/CMakeLists.txt | 2 +- vtkm/cont/cuda/internal/CMakeLists.txt | 2 +- vtkm/cont/openmp/CMakeLists.txt | 2 +- vtkm/cont/openmp/internal/CMakeLists.txt | 2 +- vtkm/cont/tbb/CMakeLists.txt | 2 +- vtkm/cont/tbb/internal/CMakeLists.txt | 9 +- vtkm/exec/CMakeLists.txt | 5 +- vtkm/exec/cuda/internal/CMakeLists.txt | 2 +- vtkm/filter/CMakeLists.txt | 4 +- vtkm/interop/CMakeLists.txt | 2 +- vtkm/interop/cuda/CMakeLists.txt | 2 +- vtkm/interop/cuda/internal/CMakeLists.txt | 2 +- vtkm/interop/internal/CMakeLists.txt | 2 +- vtkm/interop/testing/CMakeLists.txt | 2 +- vtkm/worklet/CMakeLists.txt | 5 +- .../mesh_dem_meshtypes/CMakeLists.txt | 1 - 18 files changed, 24 insertions(+), 129 deletions(-) diff --git a/CMake/VTKmWrappers.cmake b/CMake/VTKmWrappers.cmake index c3c38e5a4..7c661b54d 100644 --- a/CMake/VTKmWrappers.cmake +++ b/CMake/VTKmWrappers.cmake @@ -96,86 +96,6 @@ function(vtkm_compile_as_cuda output) set(${output} ${_cuda_srcs} PARENT_SCOPE) endfunction() -#----------------------------------------------------------------------------- -function(vtkm_add_header_build_test name dir_prefix use_cuda) - set(hfiles ${ARGN}) - - #only attempt to add a test build executable if we have any headers to - #test. this might not happen when everything depends on thrust. - list(LENGTH hfiles num_srcs) - if (${num_srcs} EQUAL 0) - return() - endif() - - set(ext "cxx") - if(use_cuda) - set(ext "cu") - endif() - - set(srcs) - foreach (header ${hfiles}) - get_source_file_property(cant_be_tested ${header} VTKm_CANT_BE_HEADER_TESTED) - if( NOT cant_be_tested ) - string(REPLACE "/" "_" headername "${header}") - string(REPLACE "." "_" headername "${headername}") - set(src ${CMAKE_CURRENT_BINARY_DIR}/TB_${headername}.${ext}) - - #By using file generate we will not trigger CMake execution when - #a header gets touched - file(GENERATE - OUTPUT ${src} - CONTENT " -//mark that we are including headers as test for completeness. -//This is used by headers that include thrust to properly define a proper -//device backend / system -#define VTKM_TEST_HEADER_BUILD -#include <${dir_prefix}/${header}> -int ${headername}_${headerextension}_testbuild_symbol;" - ) - - list(APPEND srcs ${src}) - endif() - endforeach() - - set_source_files_properties(${hfiles} - PROPERTIES HEADER_FILE_ONLY TRUE - ) - - if(TARGET TestBuild_${name}) - #If the target already exists just add more sources to it - target_sources(TestBuild_${name} PRIVATE ${srcs}) - else() - add_library(TestBuild_${name} STATIC ${srcs} ${hfiles}) - # Send the libraries created for test builds to their own directory so as to - # not pollute the directory with useful libraries. - set_property(TARGET TestBuild_${name} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH}/testbuilds) - set_property(TARGET TestBuild_${name} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH}/testbuilds) - - target_link_libraries(TestBuild_${name} - PRIVATE - $ - vtkm_compiler_flags - vtkm_taotuple - ) - - if(TARGET vtkm::tbb) - #make sure that we have the tbb include paths when tbb is enabled. - target_link_libraries(TestBuild_${name} PRIVATE vtkm::tbb) - endif() - - if(TARGET vtkm_diy) - target_link_libraries(TestBuild_${name} PRIVATE vtkm_diy) - endif() - - if(TARGET vtkm_rendering_gl_context) - target_link_libraries(TestBuild_${name} PRIVATE vtkm_rendering_gl_context) - endif() - - - endif() - -endfunction() - #----------------------------------------------------------------------------- function(vtkm_generate_export_header lib_name) # Get the location of this library in the directory structure @@ -229,36 +149,15 @@ endfunction(vtkm_install_headers) #----------------------------------------------------------------------------- function(vtkm_declare_headers) - #TODO: look at the testable and cuda options set(options CUDA) - set(oneValueArgs TESTABLE) - set(multiValueArgs EXCLUDE_FROM_TESTING) + set(oneValueArgs) + 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_DH_EXCLUDE_FROM_TESTING}) vtkm_get_kit_name(name dir_prefix) - - #only do header testing if enable testing is turned on - if (VTKm_ENABLE_TESTING AND VTKm_DH_TESTABLE) - set_source_files_properties(${VTKm_DH_EXCLUDE_FROM_TESTING} - PROPERTIES VTKm_CANT_BE_HEADER_TESTED TRUE - ) - - vtkm_add_header_build_test( - "${name}" "${dir_prefix}" "${VTKm_DH_CUDA}" ${hfiles}) - endif() - vtkm_install_headers("${dir_prefix}" ${hfiles}) endfunction(vtkm_declare_headers) diff --git a/vtkm/CMakeLists.txt b/vtkm/CMakeLists.txt index fd2b95648..7789d459a 100644 --- a/vtkm/CMakeLists.txt +++ b/vtkm/CMakeLists.txt @@ -75,8 +75,6 @@ vtkm_pyexpander_generated_file(Math.h) vtkm_declare_headers( ${headers} ${template_sources} - EXCLUDE_FROM_TESTING - ${template_sources} ) #----------------------------------------------------------------------------- diff --git a/vtkm/cont/cuda/CMakeLists.txt b/vtkm/cont/cuda/CMakeLists.txt index 0b0e843a6..15db3585d 100644 --- a/vtkm/cont/cuda/CMakeLists.txt +++ b/vtkm/cont/cuda/CMakeLists.txt @@ -26,7 +26,7 @@ set(headers #----------------------------------------------------------------------------- add_subdirectory(internal) -vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA}) +vtkm_declare_headers(CUDA ${headers}) #----------------------------------------------------------------------------- if (TARGET vtkm::cuda) diff --git a/vtkm/cont/cuda/internal/CMakeLists.txt b/vtkm/cont/cuda/internal/CMakeLists.txt index 1a048bf51..44e2f4d90 100644 --- a/vtkm/cont/cuda/internal/CMakeLists.txt +++ b/vtkm/cont/cuda/internal/CMakeLists.txt @@ -33,7 +33,7 @@ set(headers VirtualObjectTransferCuda.h ) -vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA}) +vtkm_declare_headers(CUDA ${headers}) if (TARGET vtkm::cuda) diff --git a/vtkm/cont/openmp/CMakeLists.txt b/vtkm/cont/openmp/CMakeLists.txt index 57fd4b96f..a50f56b14 100644 --- a/vtkm/cont/openmp/CMakeLists.txt +++ b/vtkm/cont/openmp/CMakeLists.txt @@ -24,7 +24,7 @@ set(headers add_subdirectory(internal) -vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_OPENMP}) +vtkm_declare_headers(${headers}) #----------------------------------------------------------------------------- if (TARGET vtkm::openmp) diff --git a/vtkm/cont/openmp/internal/CMakeLists.txt b/vtkm/cont/openmp/internal/CMakeLists.txt index 32604dce5..808e91523 100644 --- a/vtkm/cont/openmp/internal/CMakeLists.txt +++ b/vtkm/cont/openmp/internal/CMakeLists.txt @@ -32,7 +32,7 @@ set(headers VirtualObjectTransferOpenMP.h ) -vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_OPENMP}) +vtkm_declare_headers(${headers}) #These sources need to always be built target_sources(vtkm_cont PRIVATE diff --git a/vtkm/cont/tbb/CMakeLists.txt b/vtkm/cont/tbb/CMakeLists.txt index a75fa6c55..6ad70fdcd 100644 --- a/vtkm/cont/tbb/CMakeLists.txt +++ b/vtkm/cont/tbb/CMakeLists.txt @@ -24,7 +24,7 @@ set(headers add_subdirectory(internal) -vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_TBB}) +vtkm_declare_headers(${headers}) #----------------------------------------------------------------------------- if (TARGET vtkm::tbb) diff --git a/vtkm/cont/tbb/internal/CMakeLists.txt b/vtkm/cont/tbb/internal/CMakeLists.txt index 8ecf09f3e..460158794 100644 --- a/vtkm/cont/tbb/internal/CMakeLists.txt +++ b/vtkm/cont/tbb/internal/CMakeLists.txt @@ -29,11 +29,10 @@ set(headers VirtualObjectTransferTBB.h ) -vtkm_declare_headers(ParallelSortTBB.hxx - parallel_sort.h - TESTABLE OFF) - -vtkm_declare_headers(${headers} TESTABLE ${VTKm_ENABLE_TBB}) +vtkm_declare_headers(${headers} + ParallelSortTBB.hxx + parallel_sort.h + ) #These sources need to always be built target_sources(vtkm_cont PRIVATE diff --git a/vtkm/exec/CMakeLists.txt b/vtkm/exec/CMakeLists.txt index 879c48727..534b31b5b 100644 --- a/vtkm/exec/CMakeLists.txt +++ b/vtkm/exec/CMakeLists.txt @@ -53,8 +53,9 @@ set(header_impls add_subdirectory(internal) add_subdirectory(arg) -vtkm_declare_headers(${headers}) -vtkm_declare_headers(${header_impls} TESTABLE OFF) +vtkm_declare_headers(${headers} + ${header_impls} + ) #----------------------------------------------------------------------------- diff --git a/vtkm/exec/cuda/internal/CMakeLists.txt b/vtkm/exec/cuda/internal/CMakeLists.txt index 5d8ca750c..7eef53bec 100644 --- a/vtkm/exec/cuda/internal/CMakeLists.txt +++ b/vtkm/exec/cuda/internal/CMakeLists.txt @@ -28,7 +28,7 @@ set(headers ) #----------------------------------------------------------------------------- -vtkm_declare_headers(CUDA ${headers} TESTABLE ${VTKm_ENABLE_CUDA}) +vtkm_declare_headers(CUDA ${headers}) set_source_files_properties(ThrustPatches.h PROPERTIES VTKm_CANT_BE_HEADER_TESTED TRUE) diff --git a/vtkm/filter/CMakeLists.txt b/vtkm/filter/CMakeLists.txt index bfddfc25c..4c5b8a663 100644 --- a/vtkm/filter/CMakeLists.txt +++ b/vtkm/filter/CMakeLists.txt @@ -133,9 +133,7 @@ set(header_template_sources ZFPDecompressor3D.hxx ) -vtkm_declare_headers(${headers} - EXCLUDE_FROM_TESTING ${header_template_sources} - ) +vtkm_declare_headers(${headers}) add_subdirectory(internal) diff --git a/vtkm/interop/CMakeLists.txt b/vtkm/interop/CMakeLists.txt index 88265993e..ee8160ba6 100755 --- a/vtkm/interop/CMakeLists.txt +++ b/vtkm/interop/CMakeLists.txt @@ -24,7 +24,7 @@ set(headers ) #----------------------------------------------------------------------------- -vtkm_declare_headers(${headers} TESTABLE FALSE) +vtkm_declare_headers(${headers}) if(VTKm_ENABLE_TESTING AND TARGET vtkm_rendering) add_subdirectory(testing) diff --git a/vtkm/interop/cuda/CMakeLists.txt b/vtkm/interop/cuda/CMakeLists.txt index b24342e6a..96bc84ca3 100644 --- a/vtkm/interop/cuda/CMakeLists.txt +++ b/vtkm/interop/cuda/CMakeLists.txt @@ -23,7 +23,7 @@ set(headers ) #----------------------------------------------------------------------------- -vtkm_declare_headers(CUDA ${headers} TESTABLE FALSE) +vtkm_declare_headers(CUDA ${headers}) add_subdirectory(internal) diff --git a/vtkm/interop/cuda/internal/CMakeLists.txt b/vtkm/interop/cuda/internal/CMakeLists.txt index 92f5dbdb0..903619e42 100644 --- a/vtkm/interop/cuda/internal/CMakeLists.txt +++ b/vtkm/interop/cuda/internal/CMakeLists.txt @@ -24,4 +24,4 @@ set(headers #----------------------------------------------------------------------------- # Disable test builds because we'd need to link OpenGL libraries. -vtkm_declare_headers(CUDA ${headers} TESTABLE FALSE) +vtkm_declare_headers(CUDA ${headers}) diff --git a/vtkm/interop/internal/CMakeLists.txt b/vtkm/interop/internal/CMakeLists.txt index b3544a8b3..9a0473527 100644 --- a/vtkm/interop/internal/CMakeLists.txt +++ b/vtkm/interop/internal/CMakeLists.txt @@ -25,7 +25,7 @@ set(headers ) #----------------------------------------------------------------------------- -vtkm_declare_headers(${headers} TESTABLE FALSE) +vtkm_declare_headers(${headers}) #----------------------------------------------------------------------------- if(TARGET vtkm_rendering) diff --git a/vtkm/interop/testing/CMakeLists.txt b/vtkm/interop/testing/CMakeLists.txt index d17d1e1e7..62d8b6198 100644 --- a/vtkm/interop/testing/CMakeLists.txt +++ b/vtkm/interop/testing/CMakeLists.txt @@ -22,7 +22,7 @@ set(headers TestingOpenGLInterop.h TestingTransferFancyHandles.h ) -vtkm_declare_headers(${headers} TESTABLE FALSE) +vtkm_declare_headers(${headers}) if(NOT TARGET GLUT::GLUT) diff --git a/vtkm/worklet/CMakeLists.txt b/vtkm/worklet/CMakeLists.txt index 0c26cc2a3..5c8984881 100644 --- a/vtkm/worklet/CMakeLists.txt +++ b/vtkm/worklet/CMakeLists.txt @@ -115,8 +115,9 @@ add_subdirectory(wavelets) add_subdirectory(particleadvection) add_subdirectory(zfp) -vtkm_declare_headers(${headers}) -vtkm_declare_headers(${header_impls} TESTABLE OFF) +vtkm_declare_headers(${headers} + ${header_impls} + ) #----------------------------------------------------------------------------- diff --git a/vtkm/worklet/contourtree_augmented/mesh_dem_meshtypes/CMakeLists.txt b/vtkm/worklet/contourtree_augmented/mesh_dem_meshtypes/CMakeLists.txt index be81891e9..b12da4d37 100644 --- a/vtkm/worklet/contourtree_augmented/mesh_dem_meshtypes/CMakeLists.txt +++ b/vtkm/worklet/contourtree_augmented/mesh_dem_meshtypes/CMakeLists.txt @@ -86,7 +86,6 @@ set(extra_headers #1. vtkm_declare_headers will do a flat install into the current respective # build directory vtkm_get_kit_name(name dir_prefix) -vtkm_add_header_build_test(${name} ${dir_prefix} FALSE ${extra_headers}) vtkm_install_headers("${dir_prefix}/freudenthal_2D" freudenthal_2D/Types.h) vtkm_install_headers("${dir_prefix}/freudenthal_3D" freudenthal_3D/Types.h) vtkm_install_headers("${dir_prefix}/marchingcubes_3D" marchingcubes_3D/Types.h)