diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/buildsystems/msbuild/applocal.ps1 | 52 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 3 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_cmake.cmake | 5 |
3 files changed, 42 insertions, 18 deletions
diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 55680c1f6..21e42d479 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -1,7 +1,25 @@ [cmdletbinding()] param([string]$targetBinary, [string]$installedDir, [string]$tlogFile) -function resolve($targetBinary) { +$g_searched = @{} +# Note: installedDir is actually the bin\ directory. +$g_install_root = Split-Path $installedDir -parent + +# Note: this function signature is depended upon by the qtdeploy.ps1 script introduced in 5.7.1-7 +function deployBinary([string]$targetBinaryDir, [string]$SourceDir, [string]$targetBinaryName) { + if (Test-Path "$targetBinaryDir\$targetBinaryName") { + Write-Verbose " ${targetBinaryName}: already present" + } + else { + Write-Verbose " ${targetBinaryName}: Copying $SourceDir\$targetBinaryName" + Copy-Item "$SourceDir\$targetBinaryName" $targetBinaryDir + } + "$targetBinaryDir\$targetBinaryName" + if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$targetBinaryName" } +} + +function resolve([string]$targetBinary) { + Write-Verbose "Resolving $targetBinary..." try { $targetBinaryPath = Resolve-Path $targetBinary -erroraction stop @@ -15,23 +33,29 @@ function resolve($targetBinary) { $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) $a | % { if ([string]::IsNullOrEmpty($_)) { - continue + return + } + if ($g_searched.ContainsKey($_)) { + Write-Verbose " ${_}: previously searched - Skip" + return } + $g_searched.Set_Item($_, $true) if (Test-Path "$installedDir\$_") { - if (Test-Path "$targetBinaryDir\$_") { - Write-Verbose "$_ is already present" - } - else { - Copy-Item $installedDir\$_ $targetBinaryDir - Write-Verbose "Copying $installedDir\$_ -> $_" - } - "$targetBinaryDir\$_" - if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$_" } - resolve("$targetBinaryDir\$_") + deployBinary $targetBinaryDir $installedDir "$_" + if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } + resolve "$targetBinaryDir\$_" } else { - Write-Verbose "$installedDir\$_ not found" + Write-Verbose " ${_}: $installedDir\$_ not found" } } + Write-Verbose "Done Resolving $targetBinary." +} + +# Note: This is a hack to make Qt5 work. +# Introduced with Qt package version 5.7.1-7 +if (Test-Path "$g_install_root\plugins\qtdeploy.ps1") { + . "$g_install_root\plugins\qtdeploy.ps1" } -resolve($targetBinary)
\ No newline at end of file +resolve($targetBinary) +Write-Verbose $($g_searched | out-string)
\ No newline at end of file diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 80f35edbd..8e2204dfb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -85,7 +85,8 @@ if(NOT VCPKG_TOOLCHAIN) function(add_executable name) _add_executable(${ARGV}) list(FIND ARGV "IMPORTED" IMPORTED_IDX) - if(IMPORTED_IDX EQUAL -1) + list(FIND ARGV "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) if(VCPKG_APPLOCAL_DEPS) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 36664e7bc..81616d72d 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -2,7 +2,7 @@ function(vcpkg_configure_cmake) cmake_parse_arguments(_csc "PREFER_NINJA" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) if(NOT VCPKG_PLATFORM_TOOLSET) - message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap.ps1\n powershell -exec bypass scripts\\bootstrap.ps1\n") + message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap-vcpkg.bat\n") endif() if(_csc_GENERATOR) @@ -59,6 +59,7 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS + "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP" "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /MP" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" @@ -100,7 +101,6 @@ function(vcpkg_configure_cmake) COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} -G ${GENERATOR} -DCMAKE_BUILD_TYPE=Release - -DCMAKE_PREFIX_PATH=${CURRENT_INSTALLED_DIR} -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel @@ -113,7 +113,6 @@ function(vcpkg_configure_cmake) COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} -G ${GENERATOR} -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_PREFIX_PATH=${CURRENT_INSTALLED_DIR}/debug\\\\\\\;${CURRENT_INSTALLED_DIR} -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME config-${TARGET_TRIPLET}-dbg |
