mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
commitc5b2fc0a8bAuthor: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 21:48:20 2024 +0000 Add supported compilers and tools in README.md. commit92fe366da5Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 20:45:30 2024 +0000 Fix issues discovered by header tests. commitf7f6c92143Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 20:45:06 2024 +0000 Setup header tests, add C++20 header tests + examples. The core library will always be built with C++17, but we test our headers / examples under 17 and 20. commit4b24f26b66Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 16:21:42 2024 +0000 Pass CUDA FLAGS to install tests. commit4fb672ae91Author: Allison Piper <alliepiper16@gmail.com> Date: Sat Apr 6 15:43:41 2024 +0000 Add newer GCC (13) and Clang (17, 18).
41 lines
1.4 KiB
CMake
41 lines
1.4 KiB
CMake
# For every public header, build a translation unit containing `#include <header>`
|
|
# with some various checks.
|
|
|
|
set(excluded_headers_regexes
|
|
# Should never be used externally.
|
|
"^detail"
|
|
"^internal"
|
|
)
|
|
|
|
# Meta target for all configs' header builds:
|
|
add_custom_target(nvbench.headers.all)
|
|
add_dependencies(nvbench.all nvbench.headers.all)
|
|
|
|
file(GLOB_RECURSE header_files
|
|
RELATIVE "${NVBench_SOURCE_DIR}/nvbench/"
|
|
CONFIGURE_DEPENDS
|
|
"${NVBench_SOURCE_DIR}/nvbench/*.cuh"
|
|
)
|
|
|
|
foreach (exclusion IN LISTS excluded_headers_regexes)
|
|
list(FILTER header_files EXCLUDE REGEX "${exclusion}")
|
|
endforeach()
|
|
|
|
function (nvbench_add_header_target target_name cuda_std)
|
|
foreach (header IN LISTS header_files)
|
|
set(headertest_src "headers/${target_name}/${header}.cu")
|
|
set(header_str "nvbench/${header}") # Substitution used by configure_file:
|
|
configure_file("${NVBench_SOURCE_DIR}/cmake/header_test.in.cxx" "${headertest_src}")
|
|
list(APPEND headertest_srcs "${headertest_src}")
|
|
endforeach()
|
|
|
|
add_library(${target_name} OBJECT ${headertest_srcs})
|
|
target_link_libraries(${target_name} PUBLIC nvbench::nvbench)
|
|
set_target_properties(${target_name} PROPERTIES COMPILE_FEATURES cuda_std_${cuda_std})
|
|
add_dependencies(nvbench.headers.all ${target_name})
|
|
endfunction()
|
|
|
|
foreach (std IN LISTS NVBench_DETECTED_CUDA_STANDARDS)
|
|
nvbench_add_header_target(nvbench.headers.cpp${std} ${std})
|
|
endforeach()
|