aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-03-13 14:15:56 -0700
committerGitHub <noreply@github.com>2017-03-13 14:15:56 -0700
commite387f314a832a411df643ddaf4e7e8be525ebfa4 (patch)
tree5e1c21f443be453bb6f0583280af42294ce2308b
parentca0ea93e6400a4c13ac3ab34fbb7ce49086e2081 (diff)
parent26b9278a4c73eebb2bf21beccac168d603206126 (diff)
downloadvcpkg-e387f314a832a411df643ddaf4e7e8be525ebfa4.tar.gz
vcpkg-e387f314a832a411df643ddaf4e7e8be525ebfa4.zip
Merge pull request #775 from Mixaill/msvs2017-mpir-winsdk
[mpir] detect Windows SDK version (was: retarget MSVS2017 to Windows 10 SDK)
-rw-r--r--ports/mpir/CONTROL2
-rw-r--r--ports/mpir/portfile.cmake10
-rw-r--r--scripts/cmake/vcpkg_build_msbuild.cmake42
3 files changed, 33 insertions, 21 deletions
diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL
index 2b67c7c98..fc15d9b41 100644
--- a/ports/mpir/CONTROL
+++ b/ports/mpir/CONTROL
@@ -1,3 +1,3 @@
Source: mpir
-Version: 3.0.0-1
+Version: 3.0.0-2
Description: Multiple Precision Integers and Rationals. \ No newline at end of file
diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake
index 96bfa9454..1595a6533 100644
--- a/ports/mpir/portfile.cmake
+++ b/ports/mpir/portfile.cmake
@@ -11,7 +11,7 @@ vcpkg_download_distfile(ARCHIVE_FILE
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
-if(VCPKG_PLATFORM_TOOLSET MATCHES "v141*")
+if(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(MSVC_VERSION 15)
else()
set(MSVC_VERSION 14)
@@ -27,10 +27,10 @@ else()
)
endif()
-IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
+IF (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
SET(BUILD_ARCH "Win32")
ELSE()
- SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
+ SET(BUILD_ARCH ${VCPKG_TARGET_ARCHITECTURE})
ENDIF()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
@@ -43,12 +43,10 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll
- ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(INSTALL
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll
- ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(INSTALL
@@ -77,7 +75,7 @@ else()
${SOURCE_PATH}/lib/${BUILD_ARCH}/Release/mpir.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
- file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
+ file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
endif()
message(STATUS "Installing done")
diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake
index f4a809e7f..748b47b7b 100644
--- a/scripts/cmake/vcpkg_build_msbuild.cmake
+++ b/scripts/cmake/vcpkg_build_msbuild.cmake
@@ -7,6 +7,7 @@
# vcpkg_build_msbuild(PROJECT_PATH <sln_project_path>
# [RELEASE_CONFIGURATION <release_configuration>] # (default = "Release")
# [DEBUG_CONFIGURATION <debug_configuration>] @ (default = "Debug")
+# [TARGET_PLATFORM_VERSION <windows_target_platform_version>]
# [PLATFORM <platform>] # (default = "${TRIPLET_SYSTEM_ARCH}")
# [OPTIONS arg1 [arg2 ...]]
# [OPTIONS_RELEASE arg1 [arg2 ...]]
@@ -21,9 +22,10 @@
# ``DEBUG_CONFIGURATION``
# The configuration (``/p:Configuration`` msbuild parameter)
# used for Debug builds.
-# ``DEBUG_CONFIGURATION``
-# The configuration (``/p:Configuration`` msbuild parameter)
-# used for Debug builds.
+# ``TARGET_PLATFORM_VERSION``
+# The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter)
+# ``TARGET``
+# The MSBuild target to build. (``/t:<TARGET>``)
# ``PLATFORM``
# The platform (``/p:Platform`` msbuild parameter)
# used for the build.
@@ -35,8 +37,9 @@
# The options passed to msbuild for Debug builds.
#
+
function(vcpkg_build_msbuild)
- cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN})
+ cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN})
if(NOT DEFINED _csc_RELEASE_CONFIGURATION)
set(_csc_RELEASE_CONFIGURATION Release)
@@ -47,16 +50,29 @@ function(vcpkg_build_msbuild)
if(NOT DEFINED _csc_PLATFORM)
set(_csc_PLATFORM ${TRIPLET_SYSTEM_ARCH})
endif()
+ if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION)
+ vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION)
+ endif()
+ if(NOT DEFINED _csc_TARGET)
+ set(_csc_TARGET Rebuild)
+ endif()
+
+ list(APPEND _csc_OPTIONS
+ /t:${_csc_TARGET}
+ /p:Platform=${_csc_PLATFORM}
+ /p:VCPkgLocalAppDataDisabled=true
+ /p:UseIntelMKL=No
+ /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION}
+ /m
+ )
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
vcpkg_execute_required_process(
- COMMAND msbuild ${_csc_PROJECT_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE}
+ COMMAND msbuild ${_csc_PROJECT_PATH}
/p:Configuration=${_csc_RELEASE_CONFIGURATION}
- /p:Platform=${_csc_PLATFORM}
- /p:VCPkgLocalAppDataDisabled=true
- /p:UseIntelMKL=No
- /m
+ ${_csc_OPTIONS}
+ ${_csc_OPTIONS_RELEASE}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME build-${TARGET_TRIPLET}-rel
)
@@ -64,12 +80,10 @@ function(vcpkg_build_msbuild)
message(STATUS "Building ${_csc_PROJECT_PATH} for Debug")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
vcpkg_execute_required_process(
- COMMAND msbuild ${_csc_PROJECT_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG}
+ COMMAND msbuild ${_csc_PROJECT_PATH}
/p:Configuration=${_csc_DEBUG_CONFIGURATION}
- /p:Platform=${_csc_PLATFORM}
- /p:VCPkgLocalAppDataDisabled=true
- /p:UseIntelMKL=No
- /m
+ ${_csc_OPTIONS}
+ ${_csc_OPTIONS_DEBUG}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
LOGNAME build-${TARGET_TRIPLET}-dbg
)