vcpkg/ports/libffi/portfile.cmake

69 lines
2.3 KiB
CMake
Raw Normal View History

2022-11-30 04:05:22 +08:00
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libffi/libffi
REF "v${VERSION}"
2022-11-30 04:05:22 +08:00
SHA512 e3b261a7900cec61225c768ebd443884465669e0904db3f523aaaeeed74b4c03dbe23d74ff8bb69554791a798e25894a5fcbe2b13b883d3ee38aeff4c1e16a49
HEAD_REF master
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/libffiConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DFFI_CONFIG_FILE=${CMAKE_CURRENT_LIST_DIR}/fficonfig.h"
OPTIONS_DEBUG
2018-04-18 07:18:25 +08:00
-DFFI_SKIP_HEADERS=ON
)
vcpkg_cmake_install()
# 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")
[x64-windows-release] add a single config community triplet based on x64-windows and make it work on some ports (#15983) * add a single config community triplet based on x64-windows * add a failed port, otherwise mechanism does not support empty list * add failures to baseline * remove duplicate entry * second round of failures added to baseline * third round of regressions added to CI * [ade] fix single-config builds * [ade] update refs * remove duplicate entries * [unix2dos] restore eol in script file * add even more ports now failing in singleConfig... * [libjpeg-turbo] remove unnecessary check * [libjpeg-turbo] fix references * [baseline] restore check for ports that were added recently * [libmodplug] enable single config triplets * [tensorflow-common] enable single config triplets * update baseline * fix references * remove wrong check for single config triplets * fix references * [ogre] fix single config builds * [ogre] fix references * [untested] force x64-windows-release as host triplet when testing x64-windows-release in CI * fix * [x264] fix for single config * [x264] update refs * [libffi] enable single config builds * [libffi] update refs * remove cli broken arguments * [calceph] enable single-config builds * [calceph] fix references * [kf5config] enable single-config builds * [kf5config] fix references * [detours] enable single-config builds * [detours] fix references * [kf5*] enable single-config builds * [kf5*] fix references * fix * kf5config fix reference * trying again to force host triplet in CI * [boost] fix for single-config builds * [boost] update references * fix * [boost] update refs * disable host triplet in ci because it's not necessary * retrigger a build for ports previously failing * remove host triplet in ci, not necessary anymore? * make PR dry * [tensorflow-common] bump version * [tensorflow-common] fix references * Fix version database for boost-modular-build-helper. * fix references * restore CRLF on some ports * bump versions * fix references * bump port versions * fix references * boost-modular-build-helper: Reverted due to no changes. detours, kf5config, kf5holidays, libbacktrace: Reverted due to only whitespace changes. libffi: bumped port-version libmodplug: reverted due to no functional changes ogre, ogre-next: reverted due to incorrect case of "Debug" vs. "Release" already fixed in master. And rebuilt version database. Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2021-12-20 23:50:45 +08:00
configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc" @ONLY)
# debug
[x64-windows-release] add a single config community triplet based on x64-windows and make it work on some ports (#15983) * add a single config community triplet based on x64-windows * add a failed port, otherwise mechanism does not support empty list * add failures to baseline * remove duplicate entry * second round of failures added to baseline * third round of regressions added to CI * [ade] fix single-config builds * [ade] update refs * remove duplicate entries * [unix2dos] restore eol in script file * add even more ports now failing in singleConfig... * [libjpeg-turbo] remove unnecessary check * [libjpeg-turbo] fix references * [baseline] restore check for ports that were added recently * [libmodplug] enable single config triplets * [tensorflow-common] enable single config triplets * update baseline * fix references * remove wrong check for single config triplets * fix references * [ogre] fix single config builds * [ogre] fix references * [untested] force x64-windows-release as host triplet when testing x64-windows-release in CI * fix * [x264] fix for single config * [x264] update refs * [libffi] enable single config builds * [libffi] update refs * remove cli broken arguments * [calceph] enable single-config builds * [calceph] fix references * [kf5config] enable single-config builds * [kf5config] fix references * [detours] enable single-config builds * [detours] fix references * [kf5*] enable single-config builds * [kf5*] fix references * fix * kf5config fix reference * trying again to force host triplet in CI * [boost] fix for single-config builds * [boost] update references * fix * [boost] update refs * disable host triplet in ci because it's not necessary * retrigger a build for ports previously failing * remove host triplet in ci, not necessary anymore? * make PR dry * [tensorflow-common] bump version * [tensorflow-common] fix references * Fix version database for boost-modular-build-helper. * fix references * restore CRLF on some ports * bump versions * fix references * bump port versions * fix references * boost-modular-build-helper: Reverted due to no changes. detours, kf5config, kf5holidays, libbacktrace: Reverted due to only whitespace changes. libffi: bumped port-version libmodplug: reverted due to no functional changes ogre, ogre-next: reverted due to incorrect case of "Debug" vs. "Release" already fixed in master. And rebuilt version database. Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2021-12-20 23:50:45 +08:00
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(prefix "${CURRENT_INSTALLED_DIR}/debug")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(toolexeclibdir "\${libdir}")
set(includedir "\${prefix}/../include")
configure_file("${SOURCE_PATH}/libffi.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc" @ONLY)
endif()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libffi.pc"
"-lffi" "-llibffi")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libffi.pc"
"-lffi" "-llibffi")
endif()
2020-11-10 06:34:34 +08:00
endif()
vcpkg_fixup_pkgconfig()
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
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. */
#define FFI_BUILDING
"
)
endif()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)