Skip to content

Commit a9cf097

Browse files
authored
build: set soversion to major.minor (#1357)
Release 0.11 broke backwards compatibility, meaning that different cpp-httplib versions are compatible with each other only if the major and minor version numbers are the same. This patch reflects this in the build systems. See #1209 for some more context.
1 parent 5c3624e commit a9cf097

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ if(HTTPLIB_COMPILE)
176176
set_target_properties(${PROJECT_NAME}
177177
PROPERTIES
178178
VERSION ${${PROJECT_NAME}_VERSION}
179-
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}
179+
SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}"
180180
)
181181
else()
182182
# This is for header-only.
@@ -247,13 +247,13 @@ if(HTTPLIB_COMPILE)
247247
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
248248
# Example: if you find_package(httplib 0.5.4)
249249
# then anything >= 0.5 and <= 1.0 is accepted
250-
COMPATIBILITY SameMajorVersion
250+
COMPATIBILITY SameMinorVersion
251251
)
252252
else()
253253
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
254254
# Example: if you find_package(httplib 0.5.4)
255255
# then anything >= 0.5 and <= 1.0 is accepted
256-
COMPATIBILITY SameMajorVersion
256+
COMPATIBILITY SameMinorVersion
257257
# Tells Cmake that it's a header-only lib
258258
# Mildly useful for end-users :)
259259
ARCH_INDEPENDENT

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ if get_option('cpp-httplib_compile')
7777
dependencies: deps,
7878
cpp_args: args,
7979
version: version,
80+
soversion: version.split('.')[0] + '.' + version.split('.')[1],
8081
install: true
8182
)
8283
cpp_httplib_dep = declare_dependency(compile_args: args, dependencies: deps, link_with: lib, sources: httplib_ch[1])

0 commit comments

Comments
 (0)