2020-12-30 08:00:55 +08:00
if ( NOT VCPKG_TARGET_IS_LINUX AND NOT VCPKG_TARGET_IS_OSX )
2020-11-04 15:00:54 +08:00
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 (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
2020-03-23 12:07:13 +08:00
R E P O o n e a p i - s r c / o n e T B B
2020-10-14 04:17:32 +08:00
R E F e c a 9 1 f 1 6 d 7 4 9 0 a 8 a b f d e e 6 5 2 d a d f 4 5 7 e c 8 2 0 c c 3 7 # 2020_U3
S H A 5 1 2 7 1 4 4 e 1 d c 6 8 3 0 4 b 5 3 5 8 e 6 e a 3 3 0 4 3 1 b 6 f 0 c 6 1 f a d b 1 4 7 e f a 3 5 3 a 5 b 2 4 2 7 7 7 d 6 f a b f 7 b 8 c f 9 9 b 7 9 c f f b 5 1 b 4 9 b 9 1 1 d d 1 7 a 9 f 1 8 7 9 6 1 9 d 6 e e b d f 3 1 9 f 2 3 e c 3 2 3 5 c 8 9 c f f c 2 5
2019-03-27 01:13:42 +08:00
H E A D _ R E F t b b _ 2 0 1 9
2019-12-21 04:22:42 +08:00
P A T C H E S
f i x - s t a t i c - b u i l d . p a t c h
t e r m i n a t e - w h e n - b u i l d t o o l - n o t f o u n d . p a t c h
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 } )
2021-04-09 03:01:25 +08:00
if ( TBB_DISABLE_EXCEPTIONS )
message ( STATUS "Building TBB with exception-handling constructs disabled because TBB_DISABLE_EXCEPTIONS is set to ON." )
else ( )
message ( STATUS "TBB uses exception-handling constructs by default (if supported by the compiler). This use can be disabled with 'SET(TBB_DISABLE_EXCEPTIONS ON)' in your custom triplet." )
endif ( )
2016-10-19 05:53:41 +08:00
2019-09-11 04:48:41 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
2021-04-09 03:01:25 +08:00
if ( TBB_DISABLE_EXCEPTIONS )
set ( DISABLE_EXCEPTIONS ON )
else ( )
set ( DISABLE_EXCEPTIONS OFF )
endif ( )
2018-08-29 14:19:08 +08:00
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R E F E R _ N I N J A
2021-04-09 03:01:25 +08:00
O P T I O N S - D D I S A B L E _ E X C E P T I O N S = $ { D I S A B L E _ E X C E P T I O N S }
2018-08-29 14:19:08 +08:00
)
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
2020-11-14 05:56:26 +08:00
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 ( )
2018-08-29 14:19:08 +08:00
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 ( )
2020-11-14 05:56:26 +08:00
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 )
2021-04-09 03:01:25 +08:00
file ( READ ${ CONFIGURE_FILE_NAME } SLN_CONFIGURE )
2019-09-11 04:48:41 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
string ( REPLACE "<ConfigurationType>DynamicLibrary<\/ConfigurationType>"
" < C o n f i g u r a t i o n T y p e > S t a t i c L i b r a r y < \ / C o n f i g u r a t i o n T y p e > " S L N _ C O N F I G U R E " $ { S L N _ C O N F I G U R E } " )
string ( REPLACE "\/D_CRT_SECURE_NO_DEPRECATE"
" \ / D _ C R T _ S E C U R E _ N O _ D E P R E C A T E \ / D I N _ C I L K _ S T A T I C " S L N _ C O N F I G U R E " $ { S L N _ C O N F I G U R E } " )
else ( )
string ( REPLACE "\/D_CRT_SECURE_NO_DEPRECATE"
" \ / D _ C R T _ S E C U R E _ N O _ D E P R E C A T E \ / D I N _ C I L K _ R U N T I M E " S L N _ C O N F I G U R E " $ { S L N _ C O N F I G U R E } " )
endif ( )
2021-04-09 03:01:25 +08:00
if ( TBB_DISABLE_EXCEPTIONS )
string ( REPLACE "<PreprocessorDefinitions>%(PreprocessorDefinitions)<\/PreprocessorDefinitions>"
" < P r e p r o c e s s o r D e f i n i t i o n s > T B B _ U S E _ E X C E P T I O N S = 0 ; % ( P r e p r o c e s s o r D e f i n i t i o n s ) < \ / P r e p r o c e s s o r D e f i n i t i o n s > " S L N _ C O N F I G U R E " $ { S L N _ C O N F I G U R E } " )
endif ( )
file ( WRITE ${ CONFIGURE_FILE_NAME } "${SLN_CONFIGURE}" )
2019-09-11 04:48:41 +08:00
endmacro ( )
2020-11-14 05:56:26 +08:00
2019-09-11 04:48:41 +08:00
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 (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R O J E C T _ S U B P A T H b u i l d / v s 2 0 1 3 / m a k e f i l e . s l n
R E L E A S E _ C O N F I G U R A T I O N $ { R E L E A S E _ C O N F I G U R A T I O N }
D E B U G _ C O N F I G U R A T I O N $ { D E B U G _ C O N F I G U R A T I O N }
)
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
$ { S O U R C E _ P A T H } / i n c l u d e / t b b
$ { S O U R C E _ P A T H } / i n c l u d e / s e r i a l
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e )
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
$ { S O U R C E _ P A T H } / c m a k e / t e m p l a t e s / T B B C o n f i g I n t e r n a l . c m a k e . i n
2018-08-29 14:19:08 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / t b b / T B B C o n f i g . c m a k e
@ O N L Y
)
2020-11-14 05:56:26 +08:00
configure_file (
$ { S O U R C E _ P A T H } / c m a k e / t e m p l a t e s / T B B C o n f i g V e r s i o n . c m a k e . i n
$ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / t b b / T B B C o n f i g V e r s i o n . c m a k e
@ O N L Y
)
2018-08-29 14:19:08 +08:00
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 ) "
_ c o n t e n t s
" $ { _ c o n t e n t s } "
)
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
_ c o n t e n t s
" $ { _ c o n t e n t s } "
)
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
_ c o n t e n t s
" $ { _ c o n t e n t s } "
)
2020-11-14 05:56:26 +08:00
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-11-14 05:56:26 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )