2019-05-03 13:57:43 +08:00
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
2020-05-29 04:07:54 +08:00
set ( BOND_VER 9.0.0 )
2019-06-21 05:52:28 +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
R E P O m i c r o s o f t / b o n d
2020-05-29 04:07:54 +08:00
R E F f e 6 f 5 8 2 c e 4 b e b 6 5 6 4 4 d 9 3 3 8 5 3 6 0 6 6 e 0 7 d 8 0 a 0 2 8 9 #9.0.0
S H A 5 1 2 b f 9 c 7 4 3 6 4 6 2 f a b b 4 5 1 c 6 a 5 0 b 6 6 2 4 5 5 1 4 6 a 3 7 c 1 4 2 1 a 6 f e 2 2 9 2 0 a 5 c 4 c 1 f a 7 c 0 f e 7 2 7 c 1 d 7 8 3 9 1 7 f a 1 1 9 c d 7 0 9 2 d c 1 2 0 e 3 7 5 a 9 9 a 8 e b 8 4 e 3 f c 8 7 c 1 7 b 5 4 a 2 3 b e f d 9 a b c 4
2019-06-21 05:52:28 +08:00
H E A D _ R E F m a s t e r
P A T C H E S f i x - i n s t a l l - p a t h . p a t c h
2017-02-09 11:35:04 +08:00
)
2016-10-01 10:35:29 +08:00
2020-05-26 02:52:48 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
2019-06-21 05:52:28 +08:00
vcpkg_download_distfile ( GBC_ARCHIVE
2020-05-29 04:07:54 +08:00
U R L S " h t t p s : / / g i t h u b . c o m / m i c r o s o f t / b o n d / r e l e a s e s / d o w n l o a d / $ { B O N D _ V E R } / g b c - $ { B O N D _ V E R } - a m d 6 4 . z i p "
F I L E N A M E " g b c - $ { B O N D _ V E R } - a m d 6 4 . z i p "
S H A 5 1 2 f 4 4 8 0 a 3 e b 7 a d e d f d 3 d a 5 5 4 e f 3 c d c 6 4 b 6 e 7 d a 5 c 6 9 9 b d e 0 c c d 8 6 b 2 d d 6 a 1 5 9 c c a c b b 1 d f 2 b 8 4 b 6 b c 8 0 b c 8 4 7 5 f 3 0 b 9 0 4 c b a 9 8 0 8 5 6 0 9 e 4 2 a a d 9 2 9 b 2 b 2 3 2 5 8 e a f f 5 2 0 4 8
2019-06-21 05:52:28 +08:00
)
2019-10-08 01:35:13 +08:00
2020-05-29 04:07:54 +08:00
# Clear the generator to prevent it from updating
file ( REMOVE_RECURSE ${ CURRENT_BUILDTREES_DIR } /tools/ )
2019-06-21 05:52:28 +08:00
# Extract the precompiled gbc
vcpkg_extract_source_archive ( ${ GBC_ARCHIVE } ${ CURRENT_BUILDTREES_DIR } /tools/ )
2020-05-29 04:07:54 +08:00
set ( FETCHED_GBC_PATH ${ CURRENT_BUILDTREES_DIR } /tools/gbc- ${ BOND_VER } -amd64.exe )
2017-02-09 11:35:04 +08:00
2019-06-21 05:52:28 +08:00
if ( NOT EXISTS "${FETCHED_GBC_PATH}" )
message ( FATAL_ERROR "Fetching GBC failed. Expected '${FETCHED_GBC_PATH}' to exists, but it doesn't." )
endif ( )
2019-10-08 01:35:13 +08:00
2019-06-21 05:52:28 +08:00
else ( )
2019-07-18 02:12:47 +08:00
# According to the readme on https://github.com/microsoft/bond/
# The build needs a version of the Haskel Tool stack that is newer than some distros ship with.
# For this reason the message is not guarded by checking to see if the tool is installed.
message ( "\nA recent version of Haskell Tool Stack is required to build.\n For information on how to install see https://docs.haskellstack.org/en/stable/README/\n" )
2019-10-08 01:35:13 +08:00
2017-02-09 11:35:04 +08:00
endif ( )
2016-10-01 10:35:29 +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 }
2017-12-06 05:01:50 +08:00
P R E F E R _ N I N J A
2016-10-01 10:35:29 +08:00
O P T I O N S
- D B O N D _ L I B R A R I E S _ O N L Y = T R U E
2017-02-09 11:35:04 +08:00
- D B O N D _ G B C _ P A T H = $ { F E T C H E D _ G B C _ P A T H }
2019-06-21 05:52:28 +08:00
- D B O N D _ S K I P _ G B C _ T E S T S = T R U E
2017-07-15 06:16:50 +08:00
- D B O N D _ E N A B L E _ C O M M = F A L S E
- D B O N D _ E N A B L E _ G R P C = F A L S E
2019-06-21 05:52:28 +08:00
- D B O N D _ F I N D _ R A P I D J S O N = T R U E
2016-10-01 10:35:29 +08:00
)
vcpkg_install_cmake ( )
2019-06-21 05:52:28 +08:00
vcpkg_fixup_cmake_targets ( CONFIG_PATH lib/bond TARGET_PATH share/bond )
2020-05-26 02:52:48 +08:00
vcpkg_copy_pdbs ( )
2016-10-01 10:35:29 +08:00
# There's no way to supress installation of the headers in the debug build,
# so we just delete them.
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
2019-06-21 05:52:28 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
2016-10-01 10:35:29 +08:00
2020-05-26 02:52:48 +08:00
# Put the license file where vcpkg expects it
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )