mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 13:16:17 +08:00
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.
This commit is contained in:
parent
e04b4ed5b5
commit
a2c846338c
@ -255,6 +255,11 @@ if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(mpfr PRIVATE __GMP_LIBGMP_DLL)
|
||||
endif()
|
||||
|
||||
try_compile(I_HAVE_STDARG ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/test_stdarg.c)
|
||||
if (I_HAVE_STDARG)
|
||||
target_compile_definitions(mpfr PRIVATE HAVE_STDARG)
|
||||
endif (I_HAVE_STDARG)
|
||||
|
||||
target_link_libraries(mpfr ${GMP_LIBRARIES})
|
||||
|
||||
target_include_directories(mpfr PUBLIC ${GMP_INCLUDE_DIRS})
|
||||
|
@ -1,13 +1,14 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpfr-3.1.6)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpfr-4.0.1)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.xz"
|
||||
FILENAME "mpfr-3.1.6.tar.xz"
|
||||
SHA512 746ee74d5026f267f74ab352d850ed30ff627d530aa840c71b24793e44875f8503946bd7399905dea2b2dd5744326254d7889337fe94cfe58d03c4066e9d8054
|
||||
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(
|
||||
|
6
ports/mpfr/test_stdarg.c
Normal file
6
ports/mpfr/test_stdarg.c
Normal file
@ -0,0 +1,6 @@
|
||||
# include <stdarg.h>
|
||||
|
||||
int main(int argc, char *argv) {
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user