2020-07-07 04:40:46 +08:00
|
|
|
set(VERSION 3.3)
|
|
|
|
|
2018-03-03 04:28:34 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libffi/libffi
|
2020-02-08 01:36:39 +08:00
|
|
|
REF v3.3
|
|
|
|
SHA512 62798fb31ba65fa2a0e1f71dd3daca30edcf745dc562c6f8e7126e54db92572cc63f5aa36d927dd08375bb6f38a2380ebe6c5735f35990681878fc78fc9dbc83
|
2018-03-03 04:28:34 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
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()
|
2020-07-07 04:40:46 +08:00
|
|
|
|
|
|
|
# Create pkgconfig file
|
|
|
|
set(PACKAGE_VERSION ${VERSION})
|
|
|
|
set(prefix "${CURRENT_INSTALLED_DIR}")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(toolexeclibdir "\${libdir}")
|
|
|
|
set(includedir "\${prefix}/include")
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc" @ONLY)
|
|
|
|
endif()
|
|
|
|
# debug
|
|
|
|
set(prefix "${CURRENT_INSTALLED_DIR}/debug")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(toolexeclibdir "\${libdir}")
|
|
|
|
set(includedir "\${prefix}/../include")
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc" @ONLY)
|
|
|
|
endif()
|
|
|
|
|
2018-03-03 04:28:34 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2019-10-08 02:13:05 +08:00
|
|
|
vcpkg_fixup_cmake_targets()
|
2020-07-07 04:40:46 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2020-02-08 01:36:39 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2020-04-07 05:17:22 +08:00
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ffi.h
|
|
|
|
" *know* they are going to link with the static library. */"
|
|
|
|
" *know* they are going to link with the static library. */
|
2019-10-08 01:35:13 +08:00
|
|
|
|
|
|
|
#define FFI_BUILDING
|
2020-04-07 05:17:22 +08:00
|
|
|
"
|
|
|
|
)
|
2020-02-08 01:36:39 +08:00
|
|
|
endif()
|
2018-03-03 04:28:34 +08:00
|
|
|
|
2020-07-07 04:40:46 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|