Skip to content

Commit d44a837

Browse files
committed
COMP: Ensure tbb library is built with the expected deployment target
This commit is a follow-up of these commits: * a5f774b (ENH: Add TBB support to Linux wheels) * 374c744 (ENH: Add macOS wheel TBB support) * 037a326 (ENH: Build macOS module wheels with TBB support) It ensures that oneTBB is built specifying the non-default options expected by oneTBB (See [1]) and it should ensure the library can be loaded on macOS >= 10.9. [1] https://github.com/oneapi-src/oneTBB/blob/v2021.3.0/CMakeLists.txt#L32-L39 See https://discourse.itk.org/t/itk-5-3rc4-post3-failure-to-load-libtbb-library-observed-on-macos-10-13/5405/1#suggested-path-forward-3 Close #214
1 parent d976e5b commit d44a837

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ if(ITKPythonPackage_SUPERBUILD)
105105
endif()
106106

107107
if(ITKPythonPackage_USE_TBB)
108+
109+
set(tbb_cmake_cache_args)
110+
if(CMAKE_OSX_DEPLOYMENT_TARGET)
111+
list(APPEND tbb_cmake_cache_args
112+
-DCMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG:STRING="-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}"
113+
-DCMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG:STRING="-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}"
114+
)
115+
endif()
116+
108117
ExternalProject_add(oneTBB
109118
URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.3.0.tar.gz
110119
URL_HASH SHA256=8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e
@@ -114,6 +123,7 @@ if(ITKPythonPackage_SUPERBUILD)
114123
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/../oneTBB-prefix
115124
-DCMAKE_INSTALL_LIBDIR:STRING=lib # Skip default initialization by GNUInstallDirs CMake module
116125
${ep_common_cmake_cache_args}
126+
${tbb_cmake_cache_args}
117127
-DCMAKE_BUILD_TYPE:STRING=Release
118128
BUILD_BYPRODUCTS "${TBB_DIR}/TBBConfig.cmake"
119129
USES_TERMINAL_DOWNLOAD 1

0 commit comments

Comments
 (0)