Browse Source

Appveyor: Use dynamic vcpkg libs

Julius Pfrommer 5 years ago
parent
commit
07d9893491
2 changed files with 11 additions and 17 deletions
  1. 2 4
      tools/appveyor/build.ps1
  2. 9 13
      tools/appveyor/install.ps1

+ 2 - 4
tools/appveyor/build.ps1

@@ -82,7 +82,6 @@ try {
     & cmake $cmake_cnf `
             -DBUILD_SHARED_LIBS:BOOL=OFF `
             -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-            -DCMAKE_BUILD_TYPE=RelWithDebInfo `
             -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER-$env:CC_SHORTNAME-static" `
             -DUA_BUILD_EXAMPLES:BOOL=ON `
             -DUA_ENABLE_AMALGAMATION:BOOL=OFF ..
@@ -108,7 +107,6 @@ try {
     & cmake $cmake_cnf `
             -DBUILD_SHARED_LIBS:BOOL=ON `
             -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-            -DCMAKE_BUILD_TYPE=RelWithDebInfo `
             -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER-$env:CC_SHORTNAME-dynamic" `
             -DUA_BUILD_EXAMPLES:BOOL=ON `
             -DUA_ENABLE_AMALGAMATION:BOOL=OFF ..
@@ -134,7 +132,7 @@ try {
         New-Item -ItemType directory -Path "build"
         cd build
         & cmake $cmake_cnf `
-                -DCHECK_PREFIX=c:\check `
+                -DBUILD_SHARED_LIBS:BOOL=OFF `
                 -DCMAKE_BUILD_TYPE=Debug `
                 -DUA_BUILD_EXAMPLES=OFF `
                 -DUA_BUILD_UNIT_TESTS=ON `
@@ -152,7 +150,7 @@ try {
             Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
             exit $LASTEXITCODE
         }
-        & cmake --build . --target test-verbose --config debug
+        & cmake --build . --target test-verbose --config Debug
         if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
             Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
             exit $LASTEXITCODE

+ 9 - 13
tools/appveyor/install.ps1

@@ -9,33 +9,29 @@ try {
     Write-Host -ForegroundColor Green "`n### Installing sphinx ###`n"
     & cinst sphinx --source python
 
-    Write-Host -ForegroundColor Green "`n### Installing mbedtls ###`n"
-
     if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
+       Write-Host -ForegroundColor Green "`n### Installing mbedtls via PacMan ###`n"
         # pacman may complain that the directory does not exist, thus create it.
         # See https://github.com/open62541/open62541/issues/2068
         & C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
         & C:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-mbedtls
     } elseif ($env:CC_SHORTNAME -eq "vs2015" -or $env:CC_SHORTNAME -eq "vs2017") {
-        # we need the static version, since open62541 is built with /MT
-        # vcpkg currently only supports VS2015 and newer builds
+        Write-Host -ForegroundColor Green "`n### Installing mbedtls via vcpkg ###`n"
         & vcpkg install mbedtls:x86-windows-static
-    }
-    if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
-        Write-Host -ForegroundColor Red "`n`n*** Installing mbedtls failed. Exiting ... ***"
-        exit $LASTEXITCODE
-    }
 
-    if ($env:CC_SHORTNAME -eq "vs2015" -or $env:CC_SHORTNAME -eq "vs2017") {
-        Write-Host -ForegroundColor Green "`n### Installing libcheck ###`n"
-        & appveyor DownloadFile https://github.com/Pro/check/releases/download/0.12.0_dbg/check.zip
-        & 7z x check.zip -oc:\ -bso0 -bsp0
+        Write-Host -ForegroundColor Green "`n### Installing libcheck via vcpkg ###`n"
+        & vcpkg install check:x86-windows-static
 
         Write-Host -ForegroundColor Green "`n### Installing DrMemory ###`n"
         & cinst --no-progress drmemory.portable
         $env:Path = 'C:\Program Files (x86)\Dr. Memory\bin;' + $env:Path        
     }
 
+    if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
+        Write-Host -ForegroundColor Red "`n`n*** Installing dependencies failed. Exiting ... ***"
+        exit $LASTEXITCODE
+    }
+
 } catch {
     # Print a detailed error message
     $FullException = ($_.Exception|format-list -force) | Out-String