Skip to content

Commit ca5fdd4

Browse files
authored
updated version and made the header its only source of truth (#144)
* updated version and made it only source of truth * bumped Version number
1 parent fc22f81 commit ca5fdd4

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,17 @@ include(ROCMCreatePackage)
112112
include(ROCMInstallTargets)
113113
include(ROCMCheckTargetIds)
114114

115-
rocm_setup_version(VERSION 2.0.0)
116-
project(rocshmem VERSION 2.0.0 LANGUAGES CXX)
115+
## Setup VERSION
116+
file(READ include/rocshmem/rocshmem.hpp header_text)
117+
if("${header_text}" MATCHES "constexpr char VERSION\\[\\] *= \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\";")
118+
set(VERSION_STRING ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3})
119+
else()
120+
message(FATAL_ERROR "Failed to parse Version")
121+
endif()
122+
message(STATUS "rocSHMEM Version: " "${VERSION_STRING}")
123+
124+
rocm_setup_version(VERSION ${VERSION_STRING})
125+
project(rocshmem VERSION ${VERSION_STRING} LANGUAGES CXX)
117126

118127
###############################################################################
119128
# CREATE ROCSHMEM LIBRARY

include/rocshmem/rocshmem.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
namespace rocshmem {
5454

55-
constexpr char VERSION[] = "2.0.0";
55+
constexpr char VERSION[] = "3.0.0";
5656

5757
/******************************************************************************
5858
**************************** HOST INTERFACE **********************************

0 commit comments

Comments
 (0)