CMakeLists.txt: set dylib version numbers properly. (bug #2915.)

This commit is contained in:
Ozkan Sezer 2018-10-25 11:11:02 +03:00
parent b699ddc0a9
commit 04761d7d6b
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,9 @@ set(SDL_MICRO_VERSION 9)
set(SDL_INTERFACE_AGE 0) set(SDL_INTERFACE_AGE 0)
set(SDL_BINARY_AGE 9) set(SDL_BINARY_AGE 9)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
# the following should match the versions in Xcode project file:
set(DYLIB_CURRENT_VERSION 10.0.0)
set(DYLIB_COMPATIBILITY_VERSION 1.0.0)
# Set defaults preventing destination file conflicts # Set defaults preventing destination file conflicts
set(SDL_CMAKE_DEBUG_POSTFIX "d" set(SDL_CMAKE_DEBUG_POSTFIX "d"
@ -451,6 +454,8 @@ if(USE_GCC OR USE_CLANG)
if(APPLE) if(APPLE)
list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error") list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error")
list(APPEND EXTRA_LDFLAGS "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}")
list(APPEND EXTRA_LDFLAGS "-Wl,-current_version,${DYLIB_CURRENT_VERSION}")
else() else()
set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined") set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
check_c_compiler_flag("" HAVE_NO_UNDEFINED) check_c_compiler_flag("" HAVE_NO_UNDEFINED)