@@ -63,7 +63,6 @@ Function Build-Configuration-Information {
63
63
$output = @"
64
64
Visual Studio: $ ( $Env: CMAKE_GENERATOR.Split (" " )[-2 ]) [$ ( $Env: CMAKE_GENERATOR.Split (" " )[-1 ]) ]
65
65
Architecture: $ ( $Env: Platform )
66
- Boost: v$ ( $Env: BOOST_VERSION )
67
66
libssh2: v$ ( $Env: LIBSSH2_VERSION )
68
67
libuv: v$ ( $Env: LIBUV_VERSION )
69
68
OpenSSL: v$ ( Get-OpenSSL - Version)
@@ -112,7 +111,6 @@ Function Environment-Information {
112
111
113
112
Function Initialize-Build-Environment {
114
113
# Get the versions for the third party dependencies
115
- $boost_version = $Env: BOOST_VERSION
116
114
$libssh2_version = $Env: LIBSSH2_VERSION
117
115
$libuv_version = $Env: LIBUV_VERSION
118
116
$openssl_version = Get-OpenSSL - Version
@@ -179,17 +177,15 @@ Function Initialize-Build-Environment {
179
177
}
180
178
181
179
# Generate default environment variables for per commit builds
182
- $boost_version_filename = " $ ( $boost_version.Replace (" ." , " _" )) "
180
+ If ($Env: APPVEYOR_BUILD_WORKER_IMAGE -Like " Visual Studio 2019" ) {
181
+ $boost_version_directory_suffix = " 1_71_0"
182
+ } Else {
183
+ $boost_version_directory_suffix = " 1_69_0"
184
+ }
183
185
$visual_studio_version = " $ ( $Env: VISUAL_STUDIO_INTERNAL_VERSION.Insert (2 , " ." )) "
184
186
185
187
# Generate the default Boost environment variables
186
- $Env: BOOST_ROOT = " C:/Libraries/boost_$ ( $boost_version_filename ) "
187
- $Env: BOOST_LIBRARYDIR = " $ ( $Env: BOOST_ROOT ) /$ ( $lib_architecture ) -msvc-$ ( $visual_studio_version ) "
188
- If (-Not (Test-Path - Path " $ ( $Env: BOOST_LIBRARYDIR ) " )) {
189
- # Update the Boost environment variables for CMake to find installation
190
- $Env: BOOST_ROOT = " $ ( $libs_location_prefix ) /boost-$ ( $boost_version ) "
191
- $Env: BOOST_LIBRARYDIR = " $ ( $Env: BOOST_ROOT ) /$ ( $lib_architecture ) -msvc-$ ( $visual_studio_version ) "
192
- }
188
+ $Env: BOOST_ROOT = " C:/Libraries/boost_$ ( $boost_version_directory_suffix ) "
193
189
$Env: BOOST_INCLUDEDIR = " $ ( $Env: BOOST_ROOT ) /include"
194
190
195
191
# Generate the default libssh2 environment variables
@@ -509,55 +505,6 @@ add_dependencies(`${PROJECT_NAME} `${ZLIB_LIBRARY_NAME})
509
505
}
510
506
}
511
507
512
- # Handle installation of the per commit dependencies (e.g. Test builds)
513
- # Determine if Boost should be installed (pre-installed or cached)
514
- If (-Not (Test-Path - Path " $ ( $Env: BOOST_LIBRARYDIR ) " )) {
515
- New-Item - ItemType Directory - Force - Path " $ ( $dependencies_build_location_prefix ) /boost" | Out-Null
516
- Push-Location - Path " $ ( $dependencies_build_location_prefix ) /boost"
517
-
518
- $cmakelists_contents = @"
519
- cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
520
- project(Boost)
521
- set(PROJECT_DISPLAY_NAME "AppVeyor CI Build for Boost")
522
- set(PROJECT_MODULE_DIR $cmake_modules_dir )
523
- set(CMAKE_MODULE_PATH `$ {CMAKE_MODULE_PATH} `$ {PROJECT_MODULE_DIR})
524
- include(ExternalProject-boost)
525
- set(GENERATED_SOURCE_FILE `$ {CMAKE_CURRENT_BINARY_DIR}/main.cpp)
526
- file(REMOVE `$ {GENERATED_SOURCE_FILE})
527
- file(WRITE `$ {GENERATED_SOURCE_FILE} "int main () { return 0; }")
528
- add_executable(`$ {PROJECT_NAME} `$ {GENERATED_SOURCE_FILE})
529
- add_dependencies(`$ {PROJECT_NAME} `$ {BOOST_LIBRARY_NAME})
530
- "@
531
- $cmakelists_contents | Out-File - FilePath " CMakeLists.txt" - Encoding Utf8 - Force
532
-
533
- Write-Host " Configuring Boost"
534
- cmake - G " $ ( $Env: CMAKE_GENERATOR ) " - A $Env: CMAKE_PLATFORM " -DBOOST_VERSION=$ ( $Env: BOOST_VERSION ) " " -DBOOST_INSTALL_PREFIX=$ ( $Env: BOOST_ROOT ) " .
535
- If ($LastExitCode -ne 0 ) {
536
- If (Test-Path - Path " build/CMakeFiles/CMakeOutput.log" ) {
537
- Push-AppveyorArtifact " build/CMakeFiles/CMakeOutput.log" - DeploymentName " Boost Output Log"
538
- }
539
- If (Test-Path - Path " build/CMakeFiles/CMakeError.log" ) {
540
- Push-AppveyorArtifact " build/CMakeFiles/CMakeError.log" - DeploymentName " Boost Error Log"
541
- }
542
- Pop-Location
543
- Throw " Failed to configure Boost for MSVC $ ( $Env: VISUAL_STUDIO_INTERNAL_VERSION ) -$ ( $Env: Platform ) "
544
- }
545
- Write-Host " Building and Installing Boost"
546
- cmake -- build . -- config RelWithDebInfo
547
- If ($LastExitCode -ne 0 ) {
548
- If (Test-Path - Path " build/CMakeFiles/CMakeOutput.log" ) {
549
- Push-AppveyorArtifact " build/CMakeFiles/CMakeOutput.log" - DeploymentName " Boost Output Log"
550
- }
551
- If (Test-Path - Path " build/CMakeFiles/CMakeError.log" ) {
552
- Push-AppveyorArtifact " build/CMakeFiles/CMakeError.log" - DeploymentName " Boost Error Log"
553
- }
554
- Pop-Location
555
- Throw " Failed to build Boost for MSVC $ ( $Env: VISUAL_STUDIO_INTERNAL_VERSION ) -$ ( $Env: Platform ) "
556
- }
557
-
558
- Pop-Location
559
- }
560
-
561
508
# Determine if libssh2 should be installed (cached)
562
509
If (-Not (Test-Path - Path " $ ( $Env: LIBSSH2_ROOT_DIR ) /lib" )) { # lib directory checked due to external project being CMake (automatically creates root directory)
563
510
New-Item - ItemType Directory - Force - Path " $ ( $dependencies_build_location_prefix ) /libssh2" | Out-Null
0 commit comments