vcpkg/ports/mpfr/portfile.cmake
ing. Federico Fuga a2c846338c Update mpfr to 4.0.1 and fix compilation under gcc 7
gcc 7 deprecates the use of varargs.h in favour of stdarg.h.
mpfr already fixes it, but the fix is enabled if stdarg is available.
This patch adds the test on CMakeLists.txt and enables the fix if
needed.
2018-12-13 11:59:19 +01:00

27 lines
1014 B
CMake

include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpfr-4.0.1)
vcpkg_download_distfile(ARCHIVE
URLS "http://www.mpfr.org/mpfr-4.0.1/mpfr-4.0.1.tar.xz"
FILENAME "mpfr-4.0.1.tar.xz"
SHA512 137ad68bc1e33a155edc1247fcdba27f999cf48ed526773136584090ddf2cfdfc9ea79fbf74ea1943b835b4b1ff29b05087114738c6ad3b485848540f30cac4f
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/test_stdarg.c DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/gmp_printf.c DESTINATION ${SOURCE_PATH}/src)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpfr)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/mpfr/COPYING ${CURRENT_PACKAGES_DIR}/share/mpfr/copyright)