aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorsdcb <sdflysha@qq.com>2017-01-14 10:55:19 +0800
committersdcb <sdflysha@qq.com>2017-01-14 10:55:19 +0800
commitbeec44ae8d09b31a6c137bd580bd05111adc3077 (patch)
treee444c555f550471800becec72001ce4428b95a89 /scripts
parentc104c8966f7bf2fa6576d25cc3631894008c94e1 (diff)
parent1e4e45ffcee2774a6cbe87527c140fa2107bd29d (diff)
downloadvcpkg-beec44ae8d09b31a6c137bd580bd05111adc3077.tar.gz
vcpkg-beec44ae8d09b31a6c137bd580bd05111adc3077.zip
Merge remote-tracking branch 'refs/remotes/upstream/master'
Diffstat (limited to 'scripts')
-rw-r--r--scripts/buildsystems/msbuild/applocal.ps13
-rw-r--r--scripts/cmake/vcpkg_build_cmake.cmake13
-rw-r--r--scripts/cmake/vcpkg_find_acquire_program.cmake25
3 files changed, 35 insertions, 6 deletions
diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1
index ddb4a07f9..46981fad5 100644
--- a/scripts/buildsystems/msbuild/applocal.ps1
+++ b/scripts/buildsystems/msbuild/applocal.ps1
@@ -7,6 +7,9 @@ function resolve($targetBinary) {
$a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" })
$a | % {
+ if ([string]::IsNullOrEmpty($_)) {
+ continue
+ }
if (Test-Path "$installedDir\$_") {
if (Test-Path "$targetBinaryDir\$_") {
Write-Verbose "$_ is already present"
diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake
index 8ba4b9fae..eb50222ba 100644
--- a/scripts/cmake/vcpkg_build_cmake.cmake
+++ b/scripts/cmake/vcpkg_build_cmake.cmake
@@ -1,7 +1,16 @@
function(vcpkg_build_cmake)
+ cmake_parse_arguments(_bc "MSVC_64_TOOLSET" "" "" ${ARGN})
+
+ set(MSVC_EXTRA_ARGS)
+
+ # Specifies the architecture of the toolset, NOT the architecture of the produced binary
+ if (_bc_MSVC_64_TOOLSET)
+ list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64")
+ endif()
+
message(STATUS "Build ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
- COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m
+ COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME build-${TARGET_TRIPLET}-rel
)
@@ -9,7 +18,7 @@ function(vcpkg_build_cmake)
message(STATUS "Build ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
- COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m
+ COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
LOGNAME build-${TARGET_TRIPLET}-dbg
)
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake
index 83e41fe3b..ab0cf1587 100644
--- a/scripts/cmake/vcpkg_find_acquire_program.cmake
+++ b/scripts/cmake/vcpkg_find_acquire_program.cmake
@@ -57,6 +57,12 @@ function(vcpkg_find_acquire_program VAR)
set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip")
set(ARCHIVE "jom_1_1_1.zip")
set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4)
+ elseif(VAR MATCHES "7Z")
+ set(PROGNAME 7z)
+ set(PATHS "C:/Program Files/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip)
+ set(URL "http://7-zip.org/a/7z1604.msi")
+ set(ARCHIVE "7z1604.msi")
+ set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d)
else()
message(FATAL "unknown tool ${VAR} -- unable to acquire.")
endif()
@@ -71,10 +77,21 @@ function(vcpkg_find_acquire_program VAR)
if(DEFINED NOEXTRACT)
file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME})
else()
- execute_process(
- COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE}
- WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}
- )
+ get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT)
+ string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION)
+ if(${ARCHIVE_EXTENSION} STREQUAL ".msi")
+ file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH)
+ file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}" DESTINATION_NATIVE_PATH)
+ execute_process(
+ COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH}
+ WORKING_DIRECTORY ${DOWNLOADS}
+ )
+ else()
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE}
+ WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}
+ )
+ endif()
endif()
find_program(${VAR} ${PROGNAME} PATHS ${PATHS})