From 1ed263bc5237599365b29537ec526e640ce56f5b Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Thu, 6 Aug 2020 05:08:18 +0800 Subject: [PATCH] [mpir, gmp] Add message to handle the conflicts between these two ports. (#12664) --- ports/gmp/CONTROL | 5 ----- ports/gmp/portfile.cmake | 15 +++++++++------ ports/gmp/vcpkg.json | 13 +++++++++++++ ports/mpir/portfile.cmake | 4 ++++ 4 files changed, 26 insertions(+), 11 deletions(-) delete mode 100644 ports/gmp/CONTROL create mode 100644 ports/gmp/vcpkg.json diff --git a/ports/gmp/CONTROL b/ports/gmp/CONTROL deleted file mode 100644 index 3ffdd119ab9a5c..00000000000000 --- a/ports/gmp/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: gmp -Version: 6.2.0-2 -Homepage: https://gmplib.org/ -Description: The GNU Multiple Precision Arithmetic Library -Build-Depends: vs-yasm (windows) \ No newline at end of file diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index ee4b51c087b56a..b8a289628dfc9f 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -1,3 +1,7 @@ +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") + message(FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it.") +endif() + if(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -5,9 +9,10 @@ if(VCPKG_TARGET_IS_WINDOWS) REF e140dfc8668e96d7e56cbd46467945adcc6b3cc4 #v6.2.0 SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 HEAD_REF master - PATCHES vs.build.patch - runtime.patch - prefix.patch + PATCHES + vs.build.patch + runtime.patch + prefix.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) @@ -102,6 +107,4 @@ else() # # Handle copyright file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -endif() - - +endif() \ No newline at end of file diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json new file mode 100644 index 00000000000000..77b237197aa826 --- /dev/null +++ b/ports/gmp/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "gmp", + "version-string": "6.2.0", + "port-version": 3, + "description": "The GNU Multiple Precision Arithmetic Library", + "homepage": "https://gmplib.org", + "dependencies": [ + { + "name": "vs-yasm", + "platform": "windows" + } + ] +} diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index e3ef1dc9db0ab0..856e4e273d4b55 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,5 +1,9 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") + message(FATAL_ERROR "Can't build ${PORT} if gmp is installed. Please remove gmp, and try to install ${PORT} again if you need it.") +endif() + if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "${PORT} currently can only be built using the dynamic CRT when building DLLs") endif()