2019-05-03 13:57:43 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2018-03-03 04:28:34 +08:00
|
|
|
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86 AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
|
|
|
message(FATAL_ERROR "Architecture not supported")
|
|
|
|
endif()
|
|
|
|
|
2019-05-03 13:57:43 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2018-03-03 04:28:34 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libffi/libffi
|
|
|
|
REF v3.1
|
|
|
|
SHA512 b214e4a876995f44e0a93bad5bf1b3501ea1fbedafbf33ea600007bd08c9bc965a1f0dd90ea870281c3add6c051febd19aa6cdce36f3ee8ba535ba2c0703153c
|
|
|
|
HEAD_REF master
|
2019-03-01 14:58:46 +08:00
|
|
|
PATCHES
|
|
|
|
export-global-data.patch
|
2018-03-03 04:28:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
2019-10-08 02:13:05 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/libffiConfig.cmake.in DESTINATION ${SOURCE_PATH})
|
2018-03-03 04:28:34 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-03-01 14:58:46 +08:00
|
|
|
PREFER_NINJA
|
2018-03-03 04:28:34 +08:00
|
|
|
OPTIONS
|
|
|
|
-DFFI_CONFIG_FILE=${CMAKE_CURRENT_LIST_DIR}/fficonfig.h
|
|
|
|
OPTIONS_DEBUG
|
2018-04-18 07:18:25 +08:00
|
|
|
-DFFI_SKIP_HEADERS=ON
|
|
|
|
)
|
2018-03-03 04:28:34 +08:00
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
2019-10-08 02:13:05 +08:00
|
|
|
vcpkg_fixup_cmake_targets()
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/ffi.h FFI_H)
|
|
|
|
string(REPLACE "/* *know* they are going to link with the static library. */"
|
|
|
|
"/* *know* they are going to link with the static library. */
|
|
|
|
|
|
|
|
#define FFI_BUILDING
|
|
|
|
|
|
|
|
" FFI_H "${FFI_H}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/ffi.h "${FFI_H}")
|
2018-03-03 04:28:34 +08:00
|
|
|
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libffi)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libffi/LICENSE ${CURRENT_PACKAGES_DIR}/share/libffi/copyright)
|