Skip to content

Commit 674ecc5

Browse files
committed
Merge pull request opencv#19447 from alalek:cmake_tbb_workaround_msvc
2 parents 94e1126 + eced4dd commit 674ecc5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/OpenCVDetectTBB.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ function(ocv_tbb_env_guess _found)
8282
set_target_properties(tbb PROPERTIES INTERFACE_LINK_LIBRARIES "-L${_dir}")
8383
endif()
8484
ocv_tbb_read_version("${TBB_ENV_INCLUDE}" tbb)
85+
if(NOT (TBB_INTERFACE_VERSION LESS 12000)) # >= 12000, oneTBB 2021+
86+
# avoid "defaultlib" requirement of tbb12.lib (we are using absolute path to 'tbb.lib' only)
87+
# https://github.com/oneapi-src/oneTBB/blame/2dba2072869a189b9fdab3ffa431d3ea49059a19/include/oneapi/tbb/detail/_config.h#L334
88+
target_compile_definitions(tbb INTERFACE "__TBB_NO_IMPLICIT_LINKAGE=1")
89+
endif()
8590
message(STATUS "Found TBB (env): ${TBB_ENV_LIB}")
8691
set(${_found} TRUE PARENT_SCOPE)
8792
endif()

0 commit comments

Comments
 (0)