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
2023-05-09 09:18:38 +08:00
R E F " $ { V E R S I O N } "
S H A 5 1 2 a 5 4 7 5 d 3 f 9 8 8 9 2 8 f c 3 d 0 3 b 6 9 f c 3 4 b 3 3 a d a 3 5 b d 7 9 0 1 3 8 a 0 f 4 a 7 3 3 6 4 2 5 5 8 c 7 2 9 4 5 e 7 9 c 5 d c d e 8 8 b 6 5 6 c b c 1 c a f b c 3 c b 2 d d 4 b a 2 8 0 3 1 e 0 9 e 5 0 7 d 7 3 0 0 5 6 8 7 6 1 4 8 e f 6 5 0 1 4
2019-06-21 05:52:28 +08:00
H E A D _ R E F m a s t e r
2023-06-21 03:12:03 +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
2024-05-01 02:31:53 +08:00
f i x - m s c - v e r . 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
2023-05-09 09:18:38 +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 / $ { V E R S I O N } / g b c - $ { V E R S I O N } - a m d 6 4 . z i p "
F I L E N A M E " g b c - $ { V E R S I O N } - a m d 6 4 . z i p "
S H A 5 1 2 5 9 0 b 0 5 1 a a 4 7 a d 1 6 1 f 8 a 8 a 5 f 7 8 2 e 2 2 d 2 2 0 1 a d 5 3 6 e 0 7 7 2 c 9 e 5 2 8 f 9 8 d f 1 d 1 f d 2 b 1 5 4 7 2 3 d 2 1 5 8 7 d 3 5 c 8 b 9 4 8 8 0 5 a b 2 2 9 d f b 3 b 5 1 5 2 7 3 a e 3 7 d 0 5 0 2 8 5 5 4 f d 4 9 b 3 9 d c 5 4 1 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
2021-11-30 09:02:49 +08:00
file ( REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/tools/" )
2019-06-21 05:52:28 +08:00
# Extract the precompiled gbc
2021-07-15 03:45:18 +08:00
vcpkg_extract_source_archive ( extracted_tool_dir ARCHIVE "${GBC_ARCHIVE}" NO_REMOVE_ONE_LEVEL )
file ( RENAME "${extracted_tool_dir}" "${CURRENT_BUILDTREES_DIR}/tools" )
2017-02-09 11:35:04 +08:00
2023-05-09 09:18:38 +08:00
set ( FETCHED_GBC_PATH "${CURRENT_BUILDTREES_DIR}/tools/gbc-${VERSION}-amd64.exe" )
2021-07-15 03:45:18 +08:00
if ( NOT EXISTS "${FETCHED_GBC_PATH}" )
message ( FATAL_ERROR "Fetching GBC failed. Expected '${FETCHED_GBC_PATH}' to exist, but it doesn't." )
2019-06-21 05:52:28 +08:00
endif ( )
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" )
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
2021-07-21 01:24:58 +08:00
F E A T U R E S
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
2020-06-03 07:14:26 +08:00
)
2023-06-21 03:12:03 +08:00
set ( ENV{STACK_ROOT} "${CURRENT_BUILDTREES_DIR}/stack" )
2021-11-30 09:02:49 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
D I S A B L E _ P A R A L L E L _ C O N F I G U R E
2021-07-21 01:24:58 +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
- 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 }
- D B O N D _ S K I P _ G B C _ T E S T S = T R U E
- D B O N D _ F I N D _ R A P I D J S O N = T R U E
2024-01-12 07:42:53 +08:00
- D B O N D _ S K I P _ C O R E _ T E S T S = T R U E
2021-07-21 01:24:58 +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
)
2021-11-30 09:02:49 +08:00
vcpkg_cmake_install ( )
2016-10-01 10:35:29 +08:00
2021-11-30 09:02:49 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/bond )
2019-06-21 05:52:28 +08:00
2020-05-26 02:52:48 +08:00
vcpkg_copy_pdbs ( )
2016-10-01 10:35:29 +08:00
2021-11-30 09:02:49 +08:00
cmake_path ( NATIVE_PATH SOURCE_PATH native_source_path )
foreach ( header bond_apply.h bond_const_apply.h bond_const_enum.h bond_const_reflection.h bond_const_types.h bond_enum.h bond_reflection.h bond_types.h )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/bond/core/${header}" "${native_source_path}" "" )
endforeach ( )
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.
2021-11-30 09:02:49 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
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
2023-05-09 09:18:38 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/LICENSE" )