Build: use versioned TBB library to avoid conflicts with Linux system libs

Other shared libraries already do this, but for TBB it was off by default.

The conflict would happen when LD_LIBRARY_PATH is set which overrides rpath,
either manually by the user or by the Steam launcher.

Ref #107385, #104895

Pull Request: https://projects.blender.org/blender/blender/pulls/107587
This commit is contained in:
Brecht Van Lommel
2023-05-08 12:47:32 +02:00
committed by Brecht Van Lommel
parent 3c2dc42712
commit f6b492c43d
3 changed files with 8 additions and 3 deletions

View File

@@ -254,7 +254,7 @@ else()
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}")
harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}*")
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")

View File

@@ -31,8 +31,7 @@ if(WIN32)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb${SHAREDLIBEXT}
-DTBB_LOCATION=${LIBDIR}/tbb
)
endif()

View File

@@ -7,6 +7,12 @@ set(TBB_EXTRA_ARGS
-DTBB_BUILD_TESTS=Off
-DCMAKE_DEBUG_POSTFIX=_debug
)
# TBB does not use soversion by default unlike other libs, but it's needed
# to avoid conflicts with incompatible TBB system libs in LD_LIBRARY_PATH
# or the Steam environment.
if(UNIX AND NOT APPLE)
list(APPEND TBB_EXTRA_ARGS -DTBB_SET_SOVERSION=ON)
endif()
set(TBB_LIBRARY tbb)
set(TBB_STATIC_LIBRARY Off)