Skip to content

Commit 1094494

Browse files
committed
Use the new(ish) PREFIX option of rapids-cmake version, git revision header utils.
Generate macros prefixed with NVBENCH instead of redefining them from NVBench.
1 parent eadb913 commit 1094494

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

cmake/NVBenchRapidsCMake.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ endmacro()
2020
# Called after project(...)
2121
macro(nvbench_init_rapids_cmake)
2222
rapids_cmake_build_type(Release)
23-
rapids_cmake_write_version_file("${NVBench_BINARY_DIR}/nvbench/detail/version.cuh")
23+
rapids_cmake_write_version_file(
24+
"${NVBench_BINARY_DIR}/nvbench/detail/version.cuh"
25+
PREFIX "NVBENCH"
26+
)
2427
rapids_cpm_init()
2528
endmacro()

nvbench/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ endif()
139139
rapids_cmake_write_git_revision_file(
140140
nvbench_git_revision
141141
"${NVBench_BINARY_DIR}/nvbench/detail/git_revision.cuh"
142+
PREFIX "NVBENCH"
142143
)
143144
target_link_libraries(nvbench PRIVATE nvbench_git_revision)
144145

nvbench/git_revision.cuh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,5 @@
1818

1919
#pragma once
2020

21+
// Include the auto-generated git revision header:
2122
#include <nvbench/detail/git_revision.cuh>
22-
23-
// WAR issue rapidsai/rapids-cmake#99:
24-
#define NVBENCH_GIT_BRANCH NVBench_GIT_BRANCH
25-
#define NVBENCH_GIT_SHA1 NVBench_GIT_SHA1
26-
#define NVBENCH_GIT_VERSION NVBench_GIT_VERSION
27-
#ifdef NVBench_GIT_IS_DIRTY
28-
#define NVBENCH_GIT_IS_DIRTY
29-
#endif

nvbench/version.cuh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@
1818

1919
#pragma once
2020

21+
// Include the auto-generated version header:
2122
#include <nvbench/detail/version.cuh>
2223

23-
// WAR issue rapidsai/rapids-cmake#99
24-
#define NVBENCH_VERSION_MAJOR NVBench_VERSION_MAJOR
25-
#define NVBENCH_VERSION_MINOR NVBench_VERSION_MINOR
26-
#define NVBENCH_VERSION_PATCH NVBench_VERSION_PATCH
27-
2824
// clang-format off
2925

3026
/// Numeric version as "MMmmpp"

0 commit comments

Comments
 (0)