From 1cdcb7904084484ccfa75f32ba581d9e2dda45c8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Oct 2017 13:31:02 -0700 Subject: [mpir] Enable lib/md. --- ports/mpir/CONTROL | 2 +- ports/mpir/enable-runtimelibrary-toggle.patch | 26 ++++++++++++++++++++++++++ ports/mpir/portfile.cmake | 14 ++++++++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 ports/mpir/enable-runtimelibrary-toggle.patch diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index e80853a7d..b9d1b2d74 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,3 +1,3 @@ Source: mpir -Version: 3.0.0-2 +Version: 3.0.0-3 Description: Multiple Precision Integers and Rationals. diff --git a/ports/mpir/enable-runtimelibrary-toggle.patch b/ports/mpir/enable-runtimelibrary-toggle.patch new file mode 100644 index 000000000..d0260e869 --- /dev/null +++ b/ports/mpir/enable-runtimelibrary-toggle.patch @@ -0,0 +1,26 @@ +diff --git a/build.vc/mpir_debug_lib.props b/build.vc/mpir_debug_lib.props +index b2fd57b..3937570 100644 +--- a/build.vc/mpir_debug_lib.props ++++ b/build.vc/mpir_debug_lib.props +@@ -9,7 +9,7 @@ + + + $(IntDir)dum\my\%(RelativeDir) +- MultiThreadedDebug ++ $(RuntimeLibrary) + $(TargetDir)$(TargetName).pdb + + +diff --git a/build.vc/mpir_release_lib.props b/build.vc/mpir_release_lib.props +index 6cdff3e..3937570 100644 +--- a/build.vc/mpir_release_lib.props ++++ b/build.vc/mpir_release_lib.props +@@ -9,7 +9,7 @@ + + + $(IntDir)dum\my\%(RelativeDir) +- MultiThreaded ++ $(RuntimeLibrary) + $(TargetDir)$(TargetName).pdb + + diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index cc5cab8b8..c56cfa545 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -6,8 +6,6 @@ endif() if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "MPIR currently can only be built using the dynamic CRT when building DLLs") -elseif(VCPKG_CRT_LINKAGE STREQUAL "dynamic" AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") - message(FATAL_ERROR "MPIR currently can only be built using the static CRT when building LIBs") endif() set(MPIR_VERSION 3.0.0) @@ -21,6 +19,11 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/enable-runtimelibrary-toggle.patch" +) + if(VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(MSVC_VERSION 15) else() @@ -32,8 +35,15 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") PROJECT_PATH ${SOURCE_PATH}/build.vc${MSVC_VERSION}/dll_mpir_gc/dll_mpir_gc.vcxproj ) else() + if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(RuntimeLibraryExt "") + else() + set(RuntimeLibraryExt "DLL") + endif() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/build.vc${MSVC_VERSION}/lib_mpir_gc/lib_mpir_gc.vcxproj + OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" + OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" ) endif() -- cgit v1.2.3