deps-macos.cmake 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # This ensures dependencies don't use SDK features which are not available in the version specified by Deployment target
  2. # That can happen when one uses a recent SDK but specifies an older Deployment target
  3. set(DEP_WERRORS_SDK "-Werror=partial-availability -Werror=unguarded-availability -Werror=unguarded-availability-new")
  4. set(DEP_CMAKE_OPTS
  5. "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
  6. "-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}"
  7. "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
  8. "-DCMAKE_CXX_FLAGS=${DEP_WERRORS_SDK}"
  9. "-DCMAKE_C_FLAGS=${DEP_WERRORS_SDK}"
  10. )
  11. include("deps-unix-common.cmake")
  12. set(DEP_BOOST_OSX_TARGET "")
  13. if (CMAKE_OSX_DEPLOYMENT_TARGET)
  14. set(DEP_BOOST_OSX_TARGET "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
  15. endif ()
  16. ExternalProject_Add(dep_boost
  17. EXCLUDE_FROM_ALL 1
  18. URL "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz"
  19. URL_HASH SHA256=bd0df411efd9a585e5a2212275f8762079fed8842264954675a4fddc46cfcf60
  20. BUILD_IN_SOURCE 1
  21. CONFIGURE_COMMAND ./bootstrap.sh
  22. --with-libraries=system,filesystem,thread,log,locale,regex
  23. "--prefix=${DESTDIR}/usr/local"
  24. BUILD_COMMAND ./b2
  25. -j ${NPROC}
  26. --reconfigure
  27. link=static
  28. variant=release
  29. threading=multi
  30. boost.locale.icu=off
  31. "cflags=-fPIC ${DEP_BOOST_OSX_TARGET}"
  32. "cxxflags=-fPIC ${DEP_BOOST_OSX_TARGET}"
  33. install
  34. INSTALL_COMMAND "" # b2 does that already
  35. )
  36. ExternalProject_Add(dep_libcurl
  37. EXCLUDE_FROM_ALL 1
  38. URL "https://curl.haxx.se/download/curl-7.58.0.tar.gz"
  39. URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115
  40. BUILD_IN_SOURCE 1
  41. CONFIGURE_COMMAND ./configure
  42. --enable-static
  43. --disable-shared
  44. "--with-ssl=${DESTDIR}/usr/local"
  45. --with-pic
  46. --enable-ipv6
  47. --enable-versioned-symbols
  48. --enable-threaded-resolver
  49. --with-darwinssl
  50. --without-ssl # disables OpenSSL
  51. --disable-ldap
  52. --disable-ldaps
  53. --disable-manual
  54. --disable-rtsp
  55. --disable-dict
  56. --disable-telnet
  57. --disable-pop3
  58. --disable-imap
  59. --disable-smb
  60. --disable-smtp
  61. --disable-gopher
  62. --disable-crypto-auth
  63. --without-gssapi
  64. --without-libpsl
  65. --without-libidn2
  66. --without-gnutls
  67. --without-polarssl
  68. --without-mbedtls
  69. --without-cyassl
  70. --without-nss
  71. --without-axtls
  72. --without-brotli
  73. --without-libmetalink
  74. --without-libssh
  75. --without-libssh2
  76. --without-librtmp
  77. --without-nghttp2
  78. --without-zsh-functions-dir
  79. BUILD_COMMAND make "-j${NPROC}"
  80. INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
  81. )
  82. ExternalProject_Add(dep_wxwidgets
  83. EXCLUDE_FROM_ALL 1
  84. GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets"
  85. GIT_TAG v3.1.1-patched
  86. # URL "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.tar.bz2"
  87. # URL_HASH SHA256=4cb8d23d70f9261debf7d6cfeca667fc0a7d2b6565adb8f1c484f9b674f1f27a
  88. BUILD_IN_SOURCE 1
  89. # PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/wxwidgets-pngprefix.h" src/png/pngprefix.h
  90. CONFIGURE_COMMAND env "CXXFLAGS=${DEP_WERRORS_SDK}" "CFLAGS=${DEP_WERRORS_SDK}" ./configure
  91. "--prefix=${DESTDIR}/usr/local"
  92. --disable-shared
  93. --with-osx_cocoa
  94. --with-macosx-sdk=${CMAKE_OSX_SYSROOT}
  95. "--with-macosx-version-min=${DEP_OSX_TARGET}"
  96. --with-opengl
  97. --with-regex=builtin
  98. --with-libpng=builtin
  99. --with-libxpm=builtin
  100. --with-libjpeg=builtin
  101. --with-libtiff=builtin
  102. --with-zlib
  103. --with-expat=builtin
  104. --disable-debug
  105. --disable-debug_flag
  106. BUILD_COMMAND make "-j${NPROC}" && PATH=/usr/local/opt/gettext/bin/:$ENV{PATH} make -C locale allmo
  107. INSTALL_COMMAND make install
  108. )