2016-10-01 10:35:29 +08:00
include ( vcpkg_common_functions )
2019-05-03 13:57:43 +08:00
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
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
R E F 8 . 1 . 0
S H A 5 1 2 2 8 7 a 2 d 2 9 9 0 3 6 b 5 7 e 0 5 7 6 9 0 3 b 1 f 5 3 7 2 b f 8 0 7 1 2 4 3 a d a 5 7 1 5 3 c 4 b f 2 3 1 c d c 6 6 0 f a a b 1 e 7 0 c 6 0 d d d e 5 7 a c 7 5 9 d 9 4 1 b 7 4 a f 4 b a 2 5 d 8 1 a 5 d 5 8 e 8 d b f 3 9 1 0 3 2 b 7 b 2 2 6 c 4 c d 1 8 c
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
2019-06-21 05:52:28 +08:00
if ( NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
vcpkg_download_distfile ( GBC_ARCHIVE
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 / 8 . 1 . 0 / g b c - 8 . 1 . 0 - a m d 6 4 . z i p "
F I L E N A M E " g b c - 8 . 1 . 0 - a m d 6 4 . z i p "
S H A 5 1 2 8 9 6 c 9 a 7 8 f c 7 1 4 e 0 e a 4 4 c 3 7 e d 3 6 4 0 0 e c 8 e 5 f 5 2 d 4 9 5 a 8 d 8 1 a a 8 0 8 3 4 f f 6 c d 6 3 0 3 c 7 c 9 4 e 0 6 1 2 9 f 7 b 2 2 6 9 4 1 6 a 9 e 0 f f b 6 1 4 2 3 e 8 7 4 0 6 d b 7 9 8 f b 5 b e 7 f f 0 0 f 1 4 9 8 1 5 3 0 0 8 9
)
2019-10-08 01:35:13 +08:00
2019-06-21 05:52:28 +08:00
# Extract the precompiled gbc
vcpkg_extract_source_archive ( ${ GBC_ARCHIVE } ${ CURRENT_BUILDTREES_DIR } /tools/ )
set ( FETCHED_GBC_PATH ${ CURRENT_BUILDTREES_DIR } /tools/gbc.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 )
2016-10-01 10:35:29 +08:00
# Put the license file where vcpkg expects it
file ( COPY ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/bond )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /share/bond/LICENSE ${ CURRENT_PACKAGES_DIR } /share/bond/copyright )
# 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
vcpkg_copy_pdbs ( )