2018-03-03 04:28:34 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libffi/libffi
|
2022-05-18 02:15:06 +08:00
|
|
|
REF "v${VERSION}"
|
2022-11-30 04:05:22 +08:00
|
|
|
SHA512 e3b261a7900cec61225c768ebd443884465669e0904db3f523aaaeeed74b4c03dbe23d74ff8bb69554791a798e25894a5fcbe2b13b883d3ee38aeff4c1e16a49
|
2018-03-03 04:28:34 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2021-08-31 09:19:44 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/libffiConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2021-10-07 18:22:47 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-08-31 09:19:44 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-03-03 04:28:34 +08:00
|
|
|
OPTIONS
|
2022-05-18 02:15:06 +08:00
|
|
|
"-DFFI_CONFIG_FILE=${CMAKE_CURRENT_LIST_DIR}/fficonfig.h"
|
2023-07-06 02:25:06 +08:00
|
|
|
"-DVERSION=${VERSION}"
|
2018-03-03 04:28:34 +08:00
|
|
|
OPTIONS_DEBUG
|
2018-04-18 07:18:25 +08:00
|
|
|
-DFFI_SKIP_HEADERS=ON
|
|
|
|
)
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2021-10-07 18:22:47 +08:00
|
|
|
vcpkg_cmake_install()
|
2023-07-06 02:25:06 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_cmake_config_fixup()
|
2020-07-07 04:40:46 +08:00
|
|
|
|
|
|
|
set(PACKAGE_VERSION ${VERSION})
|
|
|
|
set(prefix "${CURRENT_INSTALLED_DIR}")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(toolexeclibdir "\${libdir}")
|
|
|
|
set(includedir "\${prefix}/include")
|
2021-12-20 23:50:45 +08:00
|
|
|
configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc" @ONLY)
|
2023-07-06 02:25:06 +08:00
|
|
|
if (NOT VCPKG_BUILD_TYPE)
|
2021-12-20 23:50:45 +08:00
|
|
|
set(prefix "${CURRENT_INSTALLED_DIR}/debug")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(toolexeclibdir "\${libdir}")
|
|
|
|
set(includedir "\${prefix}/../include")
|
2020-07-07 04:40:46 +08:00
|
|
|
configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc" @ONLY)
|
|
|
|
endif()
|
2023-07-06 02:25:06 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc" " -lffi" " -llibffi")
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc" " -lffi" " -llibffi")
|
2021-10-07 18:22:47 +08:00
|
|
|
endif()
|
2020-11-10 06:34:34 +08:00
|
|
|
endif()
|
2020-07-07 04:40:46 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2023-07-06 02:25:06 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ffi.h" "!defined FFI_BUILDING" "0")
|
2020-02-08 01:36:39 +08:00
|
|
|
endif()
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2023-07-06 02:25:06 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|