0001-Respect-BUILD_SHARED_LIBS.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Common subdirectories: ../zlib-1.2.11/amiga and ./amiga
  2. diff -u ../zlib-1.2.11/CMakeLists.txt ./CMakeLists.txt
  3. --- ../zlib-1.2.11/CMakeLists.txt 2017-01-15 09:29:40.000000000 +0100
  4. +++ ./CMakeLists.txt 2021-03-24 15:24:48.190291072 +0100
  5. @@ -183,10 +183,12 @@
  6. set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
  7. endif(MINGW)
  8. -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
  9. -add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
  10. -set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
  11. -set_target_properties(zlib PROPERTIES SOVERSION 1)
  12. +add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
  13. +if (BUILD_SHARED_LIBS)
  14. + target_sources(zlib PRIVATE ${ZLIB_DLL_SRCS})
  15. + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
  16. + set_target_properties(zlib PROPERTIES SOVERSION 1)
  17. +endif()
  18. if(NOT CYGWIN)
  19. # This property causes shared libraries on Linux to have the full version
  20. @@ -201,7 +203,7 @@
  21. if(UNIX)
  22. # On unix-like platforms the library is almost always called libz
  23. - set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
  24. + set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
  25. if(NOT APPLE)
  26. set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
  27. endif()
  28. @@ -211,7 +213,7 @@
  29. endif()
  30. if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
  31. - install(TARGETS zlib zlibstatic
  32. + install(TARGETS zlib
  33. RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
  34. ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
  35. LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
  36. Common subdirectories: ../zlib-1.2.11/contrib and ./contrib
  37. Common subdirectories: ../zlib-1.2.11/doc and ./doc
  38. Common subdirectories: ../zlib-1.2.11/examples and ./examples
  39. Common subdirectories: ../zlib-1.2.11/msdos and ./msdos
  40. Common subdirectories: ../zlib-1.2.11/nintendods and ./nintendods
  41. Common subdirectories: ../zlib-1.2.11/old and ./old
  42. Common subdirectories: ../zlib-1.2.11/os400 and ./os400
  43. Common subdirectories: ../zlib-1.2.11/qnx and ./qnx
  44. Common subdirectories: ../zlib-1.2.11/test and ./test
  45. Common subdirectories: ../zlib-1.2.11/watcom and ./watcom
  46. Common subdirectories: ../zlib-1.2.11/win32 and ./win32
  47. Only in ./: ZLIB.patch