Skip to content

Commit

Permalink
cmake: fix macho {compatibility,current} version
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed May 1, 2024
1 parent 9c828da commit 9220811
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,17 @@ set_target_properties(${sdl3_net_target_name} PROPERTIES
sdl_target_link_option_version_file(${sdl3_net_target_name} "${CMAKE_CURRENT_SOURCE_DIR}/src/SDL_net.sym")

if(NOT ANDROID)
set_target_properties(${sdl3_net_target_name} PROPERTIES
SOVERSION "${SO_VERSION_MAJOR}"
VERSION "${SO_VERSION}"
)
if(APPLE)
# the SOVERSION property corresponds to the compatibility version and VERSION corresponds to the current version
# https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html#mach-o-versions
cmake_minimum_required(VERSION 3.17)
set_target_properties(${sdl3_net_target_name} PROPERTIES
SOVERSION "${DYLIB_COMPAT_VERSION}"
VERSION "${DYLIB_CURRENT_VERSION}"
MACHO_COMPATIBILITY_VERSION "${DYLIB_COMPAT_VERSION}"
MACHO_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}"
)
sdl_no_deprecated_errors(${sdl3_net_target_name})
else()
set_target_properties(${sdl3_net_target_name} PROPERTIES
SOVERSION "${SO_VERSION_MAJOR}"
VERSION "${SO_VERSION}"
)
endif()
endif()
if(SDL3NET_BUILD_SHARED_LIBS)
Expand Down

0 comments on commit 9220811

Please sign in to comment.