deps-macos.cmake 4.4 KB

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