2019-05-03 13:57:43 +08:00
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
2020-08-08 02:12:15 +08:00
set ( BOND_VER 9.0.2 )
2020-05-29 04:07:54 +08:00
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-06-03 07:14:26 +08:00
R E F $ { B O N D _ V E R }
2020-08-08 02:12:15 +08:00
S H A 5 1 2 e c e 6 3 6 b c 0 6 e 7 b a c 4 2 0 8 d 3 7 3 6 1 0 e 6 8 9 f 1 9 b 3 9 4 c a e 4 e a a 8 6 9 f 3 2 b 0 9 8 9 2 4 a 6 e 7 0 3 4 e 4 d 8 0 4 d 4 8 3 1 d 7 f 6 f d 2 5 4 0 a 6 1 9 d a f 7 7 f 4 a b 4 3 c 4 9 a a 4 4 2 a 9 c d 2 6 1 6 1 b 0 a 8 a 2 d b 0 0 0
2019-06-21 05:52:28 +08:00
H E A D _ R E F m a s t e r
2020-06-03 07:14:26 +08:00
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 s k i p - g r p c - c o m p i l a t i o n . 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 "
2020-08-08 02:12:15 +08:00
S H A 5 1 2 6 6 1 d 6 3 a 8 2 2 8 4 d 3 e c b c 7 b 5 0 d 5 f 4 9 7 2 d a d e b 6 0 7 f 9 6 6 1 2 1 0 8 a 4 a 0 8 8 7 c 6 6 8 4 a 4 1 8 e 8 b 2 6 5 5 1 6 3 5 4 5 0 4 c a 3 4 4 0 a 1 8 2 d 1 e 3 1 f 2 e b 5 8 6 1 5 3 1 1 3 3 b 4 5 5 d 8 b 6 c 0 1 a e c 4 5 a d e 5 d 3
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 ( )
2020-06-03 07:14:26 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
b o n d - o v e r - g r p c B O N D _ E N A B L E _ G R P C
)
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
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
2020-06-03 07:14:26 +08:00
- D B O N D _ S T A C K _ O P T I O N S = - - a l l o w - d i f f e r e n t - u s e r
$ { F E A T U R E _ O P T I O N S }
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 )