Skip to content

Commit

Permalink
CMakeLists.txt: set dylib version numbers properly. (bug #2915.)
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Oct 25, 2018
1 parent b699ddc commit 04761d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Expand Up @@ -46,6 +46,9 @@ set(SDL_MICRO_VERSION 9)
set(SDL_INTERFACE_AGE 0)
set(SDL_BINARY_AGE 9)
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(SDL_CMAKE_DEBUG_POSTFIX "d"
Expand Down Expand Up @@ -451,6 +454,8 @@ if(USE_GCC OR USE_CLANG)

if(APPLE)
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()
set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
check_c_compiler_flag("" HAVE_NO_UNDEFINED)
Expand Down

0 comments on commit 04761d7

Please sign in to comment.