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-06-03 07:14:26 +08:00
R E F $ { B O N D _ V E R }
S H A 5 1 2 b 6 b e d 9 b e 8 b 5 d d 2 a 7 d 5 0 c 6 b d 2 7 5 b 9 4 c 6 2 0 5 0 b 8 3 7 1 7 9 0 7 5 2 2 a 0 7 2 7 9 c c c c 5 0 e 2 0 9 3 0 6 7 9 2 c 6 f 3 c 7 f 2 0 6 a f c b 3 2 2 6 a e d 2 1 b 4 3 b 1 1 5 b 6 3 d c c c 8 0 6 e f f 5 d 9 c d 4 e 1 2 b 3 5 5 4 6 1
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 "
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 ( )
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 )