2022-07-12 07:22:28 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/spdk-isal/copyright" )
message ( FATAL_ERROR "'${PORT}' conflicts with 'spdk-isal'. Please remove spdk-isal:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again." )
endif ( )
2022-07-07 05:07:55 +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
2022-08-23 04:02:53 +08:00
R E P O i n t e l / i s a - l
R E F v 2 . 3 0 . 0
S H A 5 1 2 d 3 e c f b 7 3 2 6 0 9 7 5 3 4 b 0 6 a 7 4 b 5 8 4 1 0 0 3 3 6 5 0 9 5 2 5 a e 7 c a d c 6 1 1 2 d 0 c 2 7 e 3 d 8 7 0 4 f 3 8 1 0 e 1 8 f 5 8 3 d 3 c c 3 3 f a 2 6 6 b f e c 9 6 d b 0 2 3 6 0 7 6 2 2 b 2 2 d d b f 1 7 9 8 8 e c 4 b f 1 b b 3 b 3 b 9 b 2
2022-07-07 05:07:55 +08:00
H E A D _ R E F m a s t e r
2022-08-23 04:02:53 +08:00
P A T C H E S
o s x - a s m - s y s r o o t . p a t c h
2019-03-05 07:12:28 +08:00
)
2022-08-23 04:02:53 +08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
vcpkg_find_acquire_program ( NASM )
get_filename_component ( NASM_PATH "${NASM}" DIRECTORY )
vcpkg_add_to_path ( "${NASM_PATH}" )
endif ( )
2022-07-07 05:07:55 +08:00
2022-08-23 04:02:53 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
2022-07-07 05:07:55 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
set ( NMAKE_TARGET dll )
else ( )
set ( NMAKE_TARGET static )
endif ( )
vcpkg_build_nmake (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
P R O J E C T _ N A M E M a k e f i l e . n m a k e
T A R G E T $ { N M A K E _ T A R G E T }
2022-08-23 04:02:53 +08:00
O P T I O N S
C F L A G S _ R E L =
2022-07-07 05:07:55 +08:00
)
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
set ( NMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
file ( INSTALL "${NMAKE_BINARY_DIR}/isa-l.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin" )
file ( INSTALL "${NMAKE_BINARY_DIR}/isa-l.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" )
else ( )
file ( INSTALL "${NMAKE_BINARY_DIR}/isa-l_static.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" )
endif ( )
endif ( )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release" )
set ( NMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
file ( INSTALL "${NMAKE_BINARY_DIR}/isa-l.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin" )
file ( INSTALL "${NMAKE_BINARY_DIR}/isa-l.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" )
else ( )
file ( INSTALL "${NMAKE_BINARY_DIR}/isa-l_static.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" )
endif ( )
endif ( )
file ( GLOB ISAL_HDRS "${SOURCE_PATH}/include/*" )
file ( INSTALL ${ ISAL_HDRS } DESTINATION "${CURRENT_PACKAGES_DIR}/include/isal" )
file ( INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/isa-l.def" DESTINATION "${CURRENT_PACKAGES_DIR}/include/isal" )
2022-08-23 04:02:53 +08:00
2022-07-07 05:07:55 +08:00
else ( )
2022-08-23 04:02:53 +08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
vcpkg_find_acquire_program ( YASM )
get_filename_component ( YASM_PATH "${NASM}" DIRECTORY )
vcpkg_add_to_path ( "${YASM_PATH}" )
endif ( )
vcpkg_list ( SET options )
if ( VCPKG_TARGET_IS_MINGW )
# There is only a .def file used by nmake, no declspec(...)
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
# isal forces yasm for mingw, but stumbles over feature level detection
vcpkg_list ( APPEND options AS= )
endif ( )
2022-07-07 05:07:55 +08:00
vcpkg_configure_make (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2022-08-23 04:02:53 +08:00
O P T I O N S
$ { o p t i o n s }
# No rpl_malloc provided, and probably not depending on ‘ malloc (0)’ returning a valid pointer
a c _ c v _ f u n c _ m a l l o c _ 0 _ n o n n u l l = y e s
2022-07-07 05:07:55 +08:00
)
vcpkg_install_make ( )
2022-08-23 04:02:53 +08:00
vcpkg_fixup_pkgconfig ( )
2022-07-07 05:07:55 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
endif ( )
2019-03-05 07:12:28 +08:00
2022-08-23 04:02:53 +08:00
configure_file ( "${CMAKE_CURRENT_LIST_DIR}/unofficial-isal-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-isal/unofficial-isal-config.cmake" @ONLY )
configure_file ( "${CMAKE_CURRENT_LIST_DIR}/isalConfig.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/isalConfig.cmake" @ONLY ) # legacy
2022-07-07 05:07:55 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )