deps-macos.cmake 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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=${DEP_OSX_TARGET}"
  8. "-DCMAKE_CXX_FLAGS=${DEP_WERRORS_SDK}"
  9. "-DCMAKE_C_FLAGS=${DEP_WERRORS_SDK}"
  10. "-DCMAKE_FIND_FRAMEWORK=LAST"
  11. "-DCMAKE_FIND_APPBUNDLE=LAST"
  12. )
  13. include("deps-unix-common.cmake")
  14. if (IS_CROSS_COMPILE)
  15. if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
  16. set(_build_arch aarch64)
  17. elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
  18. set(_build_arch x86_64)
  19. endif()
  20. if (${CMAKE_OSX_ARCHITECTURES} MATCHES "arm")
  21. set(_host_arch aarch64)
  22. set(_arch_flags "-arch arm64")
  23. elseif (${CMAKE_OSX_ARCHITECTURES} MATCHES "x86_64")
  24. set(_host_arch x86_64)
  25. set(_arch_flags "-arch x86_64")
  26. endif()
  27. set(_boost_linkflags "linkflags=${_arch_flags}")
  28. set(_build_tgt --build=${_build_arch}-apple-darwin --host=${_host_arch}-apple-darwin)
  29. set(_env_curl env "CFLAGS=${_arch_flags}")
  30. endif ()
  31. ExternalProject_Add(dep_boost
  32. EXCLUDE_FROM_ALL 1
  33. URL "https://github.com/supermerill/SuperSlicer_deps/releases/download/0.4/boost_1_70_0.tar.gz"
  34. URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9
  35. BUILD_IN_SOURCE 1
  36. CONFIGURE_COMMAND ./bootstrap.sh
  37. --with-toolset=clang
  38. --with-libraries=system,iostreams,filesystem,thread,log,locale,regex
  39. "--prefix=${DESTDIR}/usr/local"
  40. BUILD_COMMAND ./b2
  41. -j ${NPROC}
  42. --reconfigure
  43. toolset=clang
  44. link=static
  45. variant=release
  46. threading=multi
  47. boost.locale.icu=off
  48. "cflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}"
  49. "cxxflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}"
  50. "mflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}"
  51. "mmflags=-fPIC ${_arch_flags} -mmacosx-version-min=${DEP_OSX_TARGET}"
  52. ${_boost_linkflags}
  53. install
  54. INSTALL_COMMAND "" # b2 does that already
  55. )
  56. ExternalProject_Add(dep_libcurl
  57. EXCLUDE_FROM_ALL 1
  58. URL "https://curl.haxx.se/download/curl-7.58.0.tar.gz"
  59. URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115
  60. BUILD_IN_SOURCE 1
  61. CONFIGURE_COMMAND ${_env_curl} ./configure
  62. ${_build_tgt}
  63. --enable-static
  64. --disable-shared
  65. "--with-ssl=${DESTDIR}/usr/local"
  66. --with-pic
  67. --enable-ipv6
  68. --enable-versioned-symbols
  69. --enable-threaded-resolver
  70. --with-darwinssl
  71. --without-ssl # disables OpenSSL
  72. --disable-ldap
  73. --disable-ldaps
  74. --disable-manual
  75. --disable-rtsp
  76. --disable-dict
  77. --disable-telnet
  78. --disable-pop3
  79. --disable-imap
  80. --disable-smb
  81. --disable-smtp
  82. --disable-gopher
  83. --without-gssapi
  84. --without-libpsl
  85. --without-libidn2
  86. --without-gnutls
  87. --without-polarssl
  88. --without-mbedtls
  89. --without-cyassl
  90. --without-nss
  91. --without-axtls
  92. --without-brotli
  93. --without-libmetalink
  94. --without-libssh
  95. --without-libssh2
  96. --without-librtmp
  97. --without-nghttp2
  98. --without-zsh-functions-dir
  99. BUILD_COMMAND make "-j${NPROC}"
  100. INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
  101. )
  102. add_dependencies(dep_openvdb dep_boost)