diff --git a/ci/build.ps1 b/ci/build.ps1 index 9b8d397c59..5b18a6a2df 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -5,7 +5,9 @@ param( ) $SourceDirectory = (Convert-Path "$PSScriptRoot/../").Replace("\", "/") -$WorkingDirectory = $pwd.Path +$WorkingDirectory = "$pwd" +$BuildOutputDirectory = "$SourceDirectory/out/build/x64/$BuildType" +$InstallDirectory = "$SourceDirectory/out/install/x64/$BuildType" $commands = @() if (!(Get-Command cl)) { @@ -18,7 +20,7 @@ cmake.exe -S "$SourceDirectory" -B "$WorkingDirectory" -DCMAKE_BUILD_TYPE:STRING=$BuildType - -DCMAKE_INSTALL_PREFIX:PATH="$SourceDirectory/out/install/$BuildType" + -DCMAKE_INSTALL_PREFIX:PATH="$InstallDirectory" -DDISABLE_PYTHON_BINDINGS=1 ` 2>&1 "@.Replace("`r`n", "") @@ -30,4 +32,14 @@ cmake.exe --build $WorkingDirectory --config $BuildType $commands += @" cmake.exe --install $WorkingDirectory "@ -cmd /c ($commands -join " && ") \ No newline at end of file +cmd /c ($commands -join " && ") + +Write-Host "Copying build output to $BuildOutputDirectory..." +mkdir $BuildOutputDirectory -Force | Out-Null +Get-ChildItem $WorkingDirectory -Recurse -Attributes !ReparsePoint | foreach { + $path = $_.FullName.Replace("$pwd", $BuildOutputDirectory) + $parent = Split-Path -Parent $path + mkdir $parent -Force | Out-Null + Copy-Item $_.FullName -Destination $path -Force +} +Write-Host "Done." \ No newline at end of file diff --git a/ci/windows/Dockerfile b/ci/windows/Dockerfile index c6ce894f74..c6bfe16fc8 100644 --- a/ci/windows/Dockerfile +++ b/ci/windows/Dockerfile @@ -42,6 +42,7 @@ RUN choco install python -y # Can't install a proper msys2 because it caused console hanging in the container during docker build. RUN choco install msysgit -y RUN choco install sed -y +RUN choco install powershell-core -y # Set working environment. RUN setx /M PATH "%PATH%;C:\\Program Files\\Git\\bin" @@ -53,4 +54,4 @@ ADD default C:\Users\ContainerAdministrator\.conan\profiles\default # Define the entry point for the docker container. # This entry point starts the developer command prompt and launches the PowerShell shell. -ENTRYPOINT ["C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"] \ No newline at end of file +ENTRYPOINT ["C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&", "pwsh.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"] \ No newline at end of file