From 12b45d864be5661e30e0f166213638632a05597d Mon Sep 17 00:00:00 2001 From: Diy Upstream Date: Fri, 16 Jun 2023 17:52:26 -0400 Subject: [PATCH] diy 2023-06-16 (3ee23f39) Code extracted from: https://gitlab.kitware.com/third-party/diy2.git at commit 3ee23f39193a00e4b601b65bb970d0631eec1662 (for/vtk-m-20230616-g40ea01f9). --- CMakeLists.txt | 24 +++++++++++++++++------- include/vtkmdiy/mpi/no-mpi.hpp | 2 +- include/vtkmdiy/serialization.hpp | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c02928b3f..344398ea9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,12 @@ endif() if (NOT DEFINED diy_export_name) set(diy_export_name "diy_targets") endif() +if (NOT DEFINED diy_development_component) + set(diy_development_component "development") +endif() +if (NOT DEFINED diy_runtime_component) + set(diy_runtime_component "runtime") +endif() if (NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY) set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") @@ -273,22 +279,26 @@ configure_package_config_file( # install targets if (NOT DEFINED diy_install_only_libraries) # defined by parent project if building for binary distribution - install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/${diy_prefix} DESTINATION ${diy_install_include_dir}) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/${diy_prefix} + DESTINATION ${diy_install_include_dir} + COMPONENT ${diy_development_component}) if (build_diy_mpi_lib) - install(FILES ${PROJECT_BINARY_DIR}/include/${diy_prefix}/mpi/mpitypes.hpp DESTINATION ${diy_install_include_dir}/${diy_prefix}/mpi) + install(FILES ${PROJECT_BINARY_DIR}/include/${diy_prefix}/mpi/mpitypes.hpp + DESTINATION ${diy_install_include_dir}/${diy_prefix}/mpi + COMPONENT ${diy_development_component}) endif() endif() install(TARGETS ${diy_targets} EXPORT ${diy_export_name} - ARCHIVE DESTINATION ${diy_install_lib_dir} - LIBRARY DESTINATION ${diy_install_lib_dir} - RUNTIME DESTINATION ${diy_install_bin_dir}) + ARCHIVE DESTINATION ${diy_install_lib_dir} COMPONENT ${diy_development_component} + LIBRARY DESTINATION ${diy_install_lib_dir} COMPONENT ${diy_runtime_component} + RUNTIME DESTINATION ${diy_install_bin_dir} COMPONENT ${diy_runtime_component}) if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) # Only generate these files when diy is the main project export(EXPORT ${diy_export_name} NAMESPACE DIY:: FILE "${PROJECT_BINARY_DIR}/diy-targets.cmake") - install(EXPORT ${diy_export_name} NAMESPACE DIY:: DESTINATION "." FILE diy-targets.cmake) - install(FILES "${PROJECT_BINARY_DIR}/diy-config.cmake" DESTINATION ".") + install(EXPORT ${diy_export_name} NAMESPACE DIY:: DESTINATION "." FILE diy-targets.cmake COMPONENT ${diy_development_component}) + install(FILES "${PROJECT_BINARY_DIR}/diy-config.cmake" DESTINATION "." COMPONENT ${diy_development_component}) endif() if (python) diff --git a/include/vtkmdiy/mpi/no-mpi.hpp b/include/vtkmdiy/mpi/no-mpi.hpp index 6809281ea..1cc5fc387 100644 --- a/include/vtkmdiy/mpi/no-mpi.hpp +++ b/include/vtkmdiy/mpi/no-mpi.hpp @@ -2,9 +2,9 @@ #define VTKMDIY_MPI_NO_MPI_HPP #include // std::assert +#include // uintptr_t #include // std::runtime_error - static const int MPI_SUCCESS = 0; static const int MPI_ANY_SOURCE = -1; static const int MPI_ANY_TAG = -1; diff --git a/include/vtkmdiy/serialization.hpp b/include/vtkmdiy/serialization.hpp index 0492fc32a..368fc0639 100644 --- a/include/vtkmdiy/serialization.hpp +++ b/include/vtkmdiy/serialization.hpp @@ -69,7 +69,7 @@ namespace diy void wipe() { std::vector().swap(buffer); reset(); } void reset() { position = 0; } void skip(size_t s) { position += s; } - void swap(MemoryBuffer& o) { std::swap(position, o.position); buffer.swap(o.buffer); } + void swap(MemoryBuffer& o) { std::swap(position, o.position); buffer.swap(o.buffer); std::swap(blob_position, o.blob_position); blobs.swap(o.blobs); } bool empty() const { return buffer.empty(); } size_t size() const { return buffer.size(); } void reserve(size_t s) { buffer.reserve(s); }