2020-11-04 15:00:54 +08:00
|
|
|
if (NOT VCPKG_TARGET_IS_LINUX)
|
|
|
|
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp")
|
|
|
|
endif()
|
2020-03-23 12:07:13 +08:00
|
|
|
|
2017-05-22 17:57:19 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2020-03-23 12:07:13 +08:00
|
|
|
REPO oneapi-src/oneTBB
|
2020-10-14 04:17:32 +08:00
|
|
|
REF eca91f16d7490a8abfdee652dadf457ec820cc37 # 2020_U3
|
|
|
|
SHA512 7144e1dc68304b5358e6ea330431b6f0c61fadb147efa353a5b242777d6fabf7b8cf99b79cffb51b49b911dd17a9f1879619d6eebdf319f23ec3235c89cffc25
|
2019-03-27 01:13:42 +08:00
|
|
|
HEAD_REF tbb_2019
|
2019-12-21 04:22:42 +08:00
|
|
|
PATCHES
|
|
|
|
fix-static-build.patch
|
|
|
|
terminate-when-buildtool-notfound.patch
|
2018-08-29 14:19:08 +08:00
|
|
|
)
|
2017-05-22 17:57:19 +08:00
|
|
|
|
2018-08-29 14:19:08 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
2016-10-19 05:53:41 +08:00
|
|
|
|
2019-09-11 04:48:41 +08:00
|
|
|
if (NOT VCPKG_TARGET_IS_WINDOWS)
|
2018-08-29 14:19:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
)
|
2017-12-15 17:59:11 +08:00
|
|
|
|
2018-08-29 14:19:08 +08:00
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2019-04-09 14:23:31 +08:00
|
|
|
# Settings for TBBConfigInternal.cmake.in
|
2018-08-29 14:19:08 +08:00
|
|
|
set(TBB_LIB_EXT a)
|
|
|
|
set(TBB_LIB_PREFIX lib)
|
|
|
|
else()
|
|
|
|
if (VCPKG_CRT_LINKAGE STREQUAL static)
|
|
|
|
set(RELEASE_CONFIGURATION Release-MT)
|
|
|
|
set(DEBUG_CONFIGURATION Debug-MT)
|
|
|
|
else()
|
|
|
|
set(RELEASE_CONFIGURATION Release)
|
|
|
|
set(DEBUG_CONFIGURATION Debug)
|
|
|
|
endif()
|
2019-09-11 04:48:41 +08:00
|
|
|
|
|
|
|
macro(CONFIGURE_PROJ_FILE arg)
|
|
|
|
set(CONFIGURE_FILE_NAME ${arg})
|
|
|
|
set(CONFIGURE_BAK_FILE_NAME ${arg}.bak)
|
|
|
|
if (NOT EXISTS ${CONFIGURE_BAK_FILE_NAME})
|
|
|
|
configure_file(${CONFIGURE_FILE_NAME} ${CONFIGURE_BAK_FILE_NAME} COPYONLY)
|
|
|
|
endif()
|
|
|
|
configure_file(${CONFIGURE_BAK_FILE_NAME} ${CONFIGURE_FILE_NAME} COPYONLY)
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(READ ${CONFIGURE_FILE_NAME} SLN_CONFIGURE)
|
|
|
|
string(REPLACE "<ConfigurationType>DynamicLibrary<\/ConfigurationType>"
|
|
|
|
"<ConfigurationType>StaticLibrary<\/ConfigurationType>" SLN_CONFIGURE "${SLN_CONFIGURE}")
|
|
|
|
string(REPLACE "\/D_CRT_SECURE_NO_DEPRECATE"
|
|
|
|
"\/D_CRT_SECURE_NO_DEPRECATE \/DIN_CILK_STATIC" SLN_CONFIGURE "${SLN_CONFIGURE}")
|
|
|
|
file(WRITE ${CONFIGURE_FILE_NAME} "${SLN_CONFIGURE}")
|
|
|
|
else()
|
|
|
|
file(READ ${CONFIGURE_FILE_NAME} SLN_CONFIGURE)
|
|
|
|
string(REPLACE "\/D_CRT_SECURE_NO_DEPRECATE"
|
|
|
|
"\/D_CRT_SECURE_NO_DEPRECATE \/DIN_CILK_RUNTIME" SLN_CONFIGURE "${SLN_CONFIGURE}")
|
|
|
|
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)
|
2018-08-29 14:19:08 +08:00
|
|
|
|
|
|
|
vcpkg_install_msbuild(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PROJECT_SUBPATH build/vs2013/makefile.sln
|
|
|
|
RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION}
|
|
|
|
DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION}
|
|
|
|
)
|
2019-04-09 14:23:31 +08:00
|
|
|
# Settings for TBBConfigInternal.cmake.in
|
2018-08-29 14:19:08 +08:00
|
|
|
set(TBB_LIB_EXT lib)
|
|
|
|
set(TBB_LIB_PREFIX)
|
|
|
|
endif()
|
2016-10-19 05:53:41 +08:00
|
|
|
|
2016-10-19 08:14:54 +08:00
|
|
|
file(COPY
|
|
|
|
${SOURCE_PATH}/include/tbb
|
|
|
|
${SOURCE_PATH}/include/serial
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
|
|
|
2019-04-09 14:23:31 +08:00
|
|
|
# Settings for TBBConfigInternal.cmake.in
|
2018-08-29 14:19:08 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
set(TBB_DEFAULT_COMPONENTS tbb tbbmalloc)
|
|
|
|
else()
|
|
|
|
set(TBB_DEFAULT_COMPONENTS tbb tbbmalloc tbbmalloc_proxy)
|
|
|
|
endif()
|
2019-04-03 09:05:23 +08:00
|
|
|
|
2018-08-29 14:19:08 +08:00
|
|
|
file(READ "${SOURCE_PATH}/include/tbb/tbb_stddef.h" _tbb_stddef)
|
|
|
|
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_stddef}")
|
|
|
|
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_stddef}")
|
|
|
|
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_stddef}")
|
|
|
|
set(TBB_VERSION "${_tbb_ver_major}.${_tbb_ver_minor}")
|
|
|
|
set(TBB_RELEASE_DIR "\${_tbb_root}/lib")
|
|
|
|
set(TBB_DEBUG_DIR "\${_tbb_root}/debug/lib")
|
2017-06-08 01:33:21 +08:00
|
|
|
|
2018-08-29 14:19:08 +08:00
|
|
|
configure_file(
|
2019-04-09 14:23:31 +08:00
|
|
|
${SOURCE_PATH}/cmake/templates/TBBConfigInternal.cmake.in
|
2018-08-29 14:19:08 +08:00
|
|
|
${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake _contents)
|
2017-06-08 01:33:21 +08:00
|
|
|
string(REPLACE
|
2018-08-29 14:19:08 +08:00
|
|
|
"get_filename_component(_tbb_root \"\${_tbb_root}\" PATH)"
|
|
|
|
"get_filename_component(_tbb_root \"\${_tbb_root}\" PATH)\nget_filename_component(_tbb_root \"\${_tbb_root}\" PATH)"
|
|
|
|
_contents
|
|
|
|
"${_contents}"
|
|
|
|
)
|
2019-04-09 14:23:31 +08:00
|
|
|
string(REPLACE
|
2019-07-03 10:46:14 +08:00
|
|
|
"set(_tbb_release_lib \"/${TBB_LIB_PREFIX}"
|
|
|
|
"set(_tbb_release_lib \"\${_tbb_root}/lib/${TBB_LIB_PREFIX}"
|
2019-04-09 14:23:31 +08:00
|
|
|
_contents
|
|
|
|
"${_contents}"
|
|
|
|
)
|
|
|
|
string(REPLACE
|
2019-07-03 10:46:14 +08:00
|
|
|
"set(_tbb_debug_lib \"/${TBB_LIB_PREFIX}"
|
|
|
|
"set(_tbb_debug_lib \"\${_tbb_root}/debug/lib/${TBB_LIB_PREFIX}"
|
2019-04-09 14:23:31 +08:00
|
|
|
_contents
|
|
|
|
"${_contents}"
|
|
|
|
)
|
2018-08-29 14:19:08 +08:00
|
|
|
string(REPLACE "SHARED IMPORTED)" "UNKNOWN IMPORTED)" _contents "${_contents}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake "${_contents}")
|
2016-10-19 05:53:41 +08:00
|
|
|
|
2019-12-21 04:22:42 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb)
|
2016-10-19 05:53:41 +08:00
|
|
|
# Handle copyright
|
2020-03-26 11:43:02 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|