deps-macos.cmake 4.2 KB

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