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 } "
2024-10-03 22:53:47 +08:00
S H A 5 1 2 b 0 0 e 3 7 1 6 8 6 b b d 8 a c a 3 6 d 7 0 f f b 0 7 9 a 4 6 0 3 2 3 e 9 a e c e f 7 4 3 1 d 7 8 0 1 8 8 9 1 d 2 7 c 9 a f 9 f e 0 c a d 9 f 4 8 9 b 7 e 9 8 b 3 c 9 e f 9 7 8 6 1 9 2 d 7 5 e 7 2 f e 6 8 3 5 f b 6 9 3 3 9 8 3 c c b 0 e c f 0 5 b b 9 9 d f
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
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 "
2024-10-03 22:53:47 +08:00
S H A 5 1 2 4 C D 9 2 F 0 6 6 5 E 3 6 C B 7 1 8 3 1 1 A 2 3 7 D F 8 0 B 8 C D 9 3 B F E 3 3 9 7 1 F 6 4 6 0 B 8 8 A 1 B 7 4 E 9 E 2 2 3 7 D 6 A E A 1 4 6 7 6 6 D 6 A E 9 2 6 7 4 E 2 D D B B B 3 2 4 5 C E B B 1 9 9 F F 5 B A 8 2 1 6 3 F E 6 9 7 8 1 3 4 0 E 0 4 7 9 A E
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 ( )
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" )