123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- $ErrorActionPreference = "Stop"
- cd $env:APPVEYOR_BUILD_FOLDER
- $make_cmd = "& $env:MAKE"
- # Collect files for .zip packing
- New-Item -ItemType directory -Path pack
- Copy-Item LICENSE pack
- Copy-Item AUTHORS pack
- Copy-Item README.md pack
- # Write-Host -ForegroundColor Green "`n###################################################################"
- # Write-Host -ForegroundColor Green "`n##### Building Documentation on $env:CC_NAME #####`n"
- # New-Item -ItemType directory -Path build
- # cd build
- # & cmake -DMIKTEX_BINARY_PATH=c:\miktex\texmfs\install\miktex\bin -DCMAKE_BUILD_TYPE=Release -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DUA_BUILD_EXAMPLES:BOOL=OFF -G"$env:CC_NAME" ..
- # & cmake --build . --target doc_latex
- # if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- # Write-Host -ForegroundColor Red "`n`n*** Make doc_latex. Exiting ... ***"
- # exit $LASTEXITCODE
- # }
- # & cmake --build . --target doc_pdf
- # if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- # Write-Host -ForegroundColor Red "`n`n*** Make doc_pdf. Exiting ... ***"
- # exit $LASTEXITCODE
- # }
- # cd ..
- # Move-Item -Path "build\doc_latex\open62541.pdf" -Destination pack\
- # Remove-Item -Path build -Recurse -Force
- Write-Host -ForegroundColor Green "`n###################################################################"
- Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME #####`n"
- New-Item -ItemType directory -Path "build"
- cd build
- & cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -G"$env:CC_NAME" ..
- Invoke-Expression $make_cmd
- if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
- exit $LASTEXITCODE
- }
- cd ..
- Remove-Item -Path build -Recurse -Force
- Write-Host -ForegroundColor Green "`n###################################################################"
- Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with full NS0 #####`n"
- New-Item -ItemType directory -Path "build"
- cd build
- & cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_FULL_NS0:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -G"$env:CC_NAME" ..
- Invoke-Expression $make_cmd
- if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
- exit $LASTEXITCODE
- }
- cd ..
- Remove-Item -Path build -Recurse -Force
- Write-Host -ForegroundColor Green "`n###################################################################"
- Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with amalgamation #####`n"
- New-Item -ItemType directory -Path "build"
- cd build
- & cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DBUILD_SHARED_LIBS:BOOL=OFF -G"$env:CC_NAME" ..
- Invoke-Expression $make_cmd
- if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
- exit $LASTEXITCODE
- }
- cd ..
- New-Item -ItemType directory -Path pack_tmp
- Move-Item -Path "build\open62541.c" -Destination pack_tmp\
- Move-Item -Path "build\open62541.h" -Destination pack_tmp\
- Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\server.exe" -Destination pack_tmp\
- Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\client.exe" -Destination pack_tmp\
- if ($env:CC_SHORTNAME -eq "mingw") {
- Move-Item -Path "build\$env:OUT_DIR_LIB\libopen62541.a" -Destination pack_tmp\
- } else {
- Move-Item -Path "build\$env:OUT_DIR_LIB\open62541.lib" -Destination pack_tmp\
- }
- & 7z a -tzip open62541-$env:CC_SHORTNAME-static.zip "$env:APPVEYOR_BUILD_FOLDER\pack\*" "$env:APPVEYOR_BUILD_FOLDER\pack_tmp\*"
- Remove-Item -Path pack_tmp -Recurse -Force
- Remove-Item -Path build -Recurse -Force
- Write-Host -ForegroundColor Green "`n###################################################################"
- Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with amalgamation and .dll #####`n"
- New-Item -ItemType directory -Path "build"
- cd build
- & cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DBUILD_SHARED_LIBS:BOOL=ON -G"$env:CC_NAME" ..
- Invoke-Expression $make_cmd
- if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
- exit $LASTEXITCODE
- }
- cd ..
- New-Item -ItemType directory -Path pack_tmp
- Move-Item -Path "build\open62541.c" -Destination pack_tmp\
- Move-Item -Path "build\open62541.h" -Destination pack_tmp\
- Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\server.exe" -Destination pack_tmp\
- Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\client.exe" -Destination pack_tmp\
- if ($env:CC_SHORTNAME -eq "mingw") {
- Move-Item -Path "build\$env:OUT_DIR_LIB\libopen62541.dll" -Destination pack_tmp\
- Move-Item -Path "build\$env:OUT_DIR_LIB\libopen62541.dll.a" -Destination pack_tmp\
- } else {
- Move-Item -Path "build\$env:OUT_DIR_LIB\open62541.dll" -Destination pack_tmp\
- Move-Item -Path "build\$env:OUT_DIR_LIB\open62541.pdb" -Destination pack_tmp\
- }
- & 7z a -tzip open62541-$env:CC_SHORTNAME-dynamic.zip "$env:APPVEYOR_BUILD_FOLDER\pack\*" "$env:APPVEYOR_BUILD_FOLDER\pack_tmp\*"
- Remove-Item -Path pack_tmp -Recurse -Force
- Remove-Item -Path build -Recurse -Force
- # Only execute unit tests on vs2015 to save compilation time
- if ($env:CC_SHORTNAME -eq "vs2015") {
- Write-Host -ForegroundColor Green "`n###################################################################"
- Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with unit tests #####`n"
- New-Item -ItemType directory -Path "build"
- cd build
- & cmake -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_EXAMPLES=OFF -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON -DUA_BUILD_UNIT_TESTS=ON -DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON -DCMAKE_LIBRARY_PATH=c:\check\lib -DCMAKE_INCLUDE_PATH=c:\check\include -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -G"$env:CC_NAME" ..
- Invoke-Expression $make_cmd
- if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
- exit $LASTEXITCODE
- }
- & cmake --build . --target test-verbose --config debug
- if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
- Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
- exit $LASTEXITCODE
- }
- }
- # do not cache log
- Remove-Item -Path c:\miktex\texmfs\data\miktex\log -Recurse -Force
|