Skip to content

Commit 72cedb8

Browse files
authored
[PTI-SDK] Increment Version and set SOVERSION (#35)
* Increment SDK version to 0.2.0 * Add minor version to SOVERSION/SONAME to denote compatibility between versions. This will eventually change back to major version after `>= 1.0.0` release. * Added warnings for when this eventually changes back. Signed-off-by: Schilling, Matthew <[email protected]>
1 parent 6ee6a46 commit 72cedb8

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

sdk/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ set(PTI_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/pti")
6161
set(PTI_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/pti")
6262
set(PTI_INSTALL_LIB_DIR "${CMAKE_INSTALL_LIBDIR}")
6363
set(PTI_INSTALL_BIN_DIR "${CMAKE_INSTALL_BINDIR}")
64+
set(PTI_API_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
65+
66+
CheckSOVersion(${PTI_API_SOVERSION})
6467

6568
set(PTI_COMPILE_FLAGS_EXPR
6669
$<$<CXX_COMPILER_ID:IntelLLVM>:-Wall
@@ -129,7 +132,7 @@ target_include_directories(
129132
set_target_properties(
130133
pti
131134
PROPERTIES VERSION "${PROJECT_VERSION}"
132-
SOVERSION "${PROJECT_VERSION_MAJOR}"
135+
SOVERSION "${PTI_API_SOVERSION}"
133136
POSITION_INDEPENDENT_CODE ON)
134137

135138
target_compile_options(pti PRIVATE ${PTI_COMPILE_FLAGS_EXPR})
@@ -154,7 +157,7 @@ target_include_directories(
154157
set_target_properties(
155158
pti_view
156159
PROPERTIES VERSION "${PROJECT_VERSION}"
157-
SOVERSION "${PROJECT_VERSION_MAJOR}"
160+
SOVERSION "${PTI_API_SOVERSION}"
158161
POSITION_INDEPENDENT_CODE ON)
159162

160163
target_compile_options(pti_view PRIVATE ${PTI_COMPILE_FLAGS_EXPR})

sdk/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.1
1+
0.2.0

sdk/cmake/Modules/macros.cmake

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ macro(GetGTPinUtil TARGET UTIL)
713713
add_custom_command(OUTPUT "${GTPIN_UTIL_PATH}/GTPIN/utils/${UTIL}.h"
714714
"${GTPIN_UTIL_PATH}/GTPIN/utils/${UTIL}.cpp"
715715
COMMAND "${PYTHON_EXECUTABLE}" "${PTI_CMAKE_MACRO_DIR}/get_gtpin_util.py" ${GTPIN_UTIL_PATH} ${CMAKE_BINARY_DIR} ${UTIL})
716-
target_sources(${TARGET} PRIVATE
716+
target_sources(${TARGET} PRIVATE
717717
"${GTPIN_UTIL_PATH}/Examples/utils/${UTIL}.cpp")
718718
target_include_directories(${TARGET}
719719
PUBLIC "${GTPIN_UTIL_PATH}/GTPIN/utils")
@@ -728,7 +728,7 @@ macro(FindGTPinUtil TARGET UTIL)
728728
NAMES ${UTIL}.cpp
729729
PATHS "${GTPIN_PATH}/Examples/utils")
730730
if(GTPIN_${UTIL}_PATH)
731-
target_sources(${TARGET} PRIVATE
731+
target_sources(${TARGET} PRIVATE
732732
${GTPIN_${UTIL}_PATH})
733733
target_include_directories(${TARGET}
734734
PUBLIC "${GTPIN_PATH}/Examples/utils")
@@ -1042,3 +1042,25 @@ macro(GetGTest)
10421042
"${EXTRA_COMPILE_OPTIONS}")
10431043
endif()
10441044
endmacro()
1045+
1046+
macro(CheckSOVersion PROJ_SOVERSION)
1047+
# Not automatically set because this should be done intentionally.
1048+
# PTI's rules for backwords compatibility should be re-evaluated upon first
1049+
# major / production release.
1050+
# PTI is following [semver](https://semver.org/) versioning and we are using
1051+
# the SOVERSION to denote backword compatibility.
1052+
if ("${PROJECT_VERSION}" VERSION_GREATER_EQUAL "1.0.0")
1053+
if("${PROJ_SOVERSION}" STREQUAL "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
1054+
message(AUTHOR_WARNING "${PROJECT_NAME} currently has the SOVERSION: "
1055+
"${PROJ_SOVERSION}. After the first major release, ${PROJECT_NAME}"
1056+
" should have the SOVERSION: ${PROJECT_VERSION_MAJOR}.")
1057+
endif()
1058+
else()
1059+
if("${PROJ_SOVERSION}" STREQUAL "${PROJECT_VERSION_MAJOR}")
1060+
message(AUTHOR_WARNING "${PROJECT_NAME} currently has the SOVERSION: "
1061+
"${PROJ_SOVERSION}. During development, ${PROJECT_NAME}"
1062+
" should have the SOVERSION:"
1063+
" ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.")
1064+
endif()
1065+
endif()
1066+
endmacro()

0 commit comments

Comments
 (0)