From c6f055ed5d7f3221002c6e1c34f4d468c3069708 Mon Sep 17 00:00:00 2001 From: Eli Arzhannikov Date: Fri, 13 Nov 2020 22:56:26 +0100 Subject: [PATCH] [tbb] fix shared tbb library configuration build under *nix (#14555) * fix shared tbb library configuration build under *nix * bump Port Version * installing missed TBBConfigVersion.cmake --- ports/tbb/CONTROL | 4 ++-- ports/tbb/portfile.cmake | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ports/tbb/CONTROL b/ports/tbb/CONTROL index 565b4a5645..5eb978f3ac 100644 --- a/ports/tbb/CONTROL +++ b/ports/tbb/CONTROL @@ -1,6 +1,6 @@ Source: tbb Version: 2020_U3 -Port-Version: 1 +Port-Version: 2 Homepage: https://github.com/01org/tbb Description: Intel's Threading Building Blocks. -Supports: !(uwp|arm|arm64) | linux \ No newline at end of file +Supports: !(uwp|arm|arm64) | linux diff --git a/ports/tbb/portfile.cmake b/ports/tbb/portfile.cmake index 2e54a53a00..5950bd7102 100644 --- a/ports/tbb/portfile.cmake +++ b/ports/tbb/portfile.cmake @@ -24,7 +24,17 @@ if (NOT VCPKG_TARGET_IS_WINDOWS) vcpkg_install_cmake() # Settings for TBBConfigInternal.cmake.in - set(TBB_LIB_EXT a) + if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(TBB_LIB_EXT a) + else() + if (VCPKG_TARGET_IS_LINUX) + set(TBB_LIB_EXT "so.2") + elseif(VCPKG_TARGET_IS_OSX) + set(TBB_LIB_EXT "dylib") + else() + set(TBB_LIB_EXT "so") + endif() + endif() set(TBB_LIB_PREFIX lib) else() if (VCPKG_CRT_LINKAGE STREQUAL static) @@ -34,7 +44,7 @@ else() set(RELEASE_CONFIGURATION Release) set(DEBUG_CONFIGURATION Debug) endif() - + macro(CONFIGURE_PROJ_FILE arg) set(CONFIGURE_FILE_NAME ${arg}) set(CONFIGURE_BAK_FILE_NAME ${arg}.bak) @@ -56,7 +66,7 @@ else() file(WRITE ${CONFIGURE_FILE_NAME} "${SLN_CONFIGURE}") endif() endmacro() - + CONFIGURE_PROJ_FILE(${SOURCE_PATH}/build/vs2013/tbb.vcxproj) CONFIGURE_PROJ_FILE(${SOURCE_PATH}/build/vs2013/tbbmalloc.vcxproj) CONFIGURE_PROJ_FILE(${SOURCE_PATH}/build/vs2013/tbbmalloc_proxy.vcxproj) @@ -97,6 +107,13 @@ configure_file( ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake @ONLY ) + +configure_file( + ${SOURCE_PATH}/cmake/templates/TBBConfigVersion.cmake.in + ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfigVersion.cmake + @ONLY +) + file(READ ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake _contents) string(REPLACE "get_filename_component(_tbb_root \"\${_tbb_root}\" PATH)" @@ -116,9 +133,10 @@ string(REPLACE _contents "${_contents}" ) + string(REPLACE "SHARED IMPORTED)" "UNKNOWN IMPORTED)" _contents "${_contents}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake "${_contents}") file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)