appveyor.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. version: '{build}'
  2. os: Visual Studio 2015 RC
  3. clone_folder: c:\projects\open62541
  4. clone_depth: 20
  5. environment:
  6. matrix:
  7. - Compiler: msvc
  8. Arch: x86
  9. - Compiler: msvc
  10. Arch: x64
  11. - Compiler: mingw
  12. Arch: x86
  13. - Compiler: mingw
  14. Arch: x64
  15. # cygwin cmake stopped working on 05.07.2016 -- commented out until a fix appears
  16. # - Compiler: cygwin
  17. # Arch: x86
  18. #
  19. # Initialisation prior to pulling the Mono repository
  20. # Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
  21. #
  22. init:
  23. - git config --global core.autocrlf input
  24. #
  25. # Install needed build dependencies
  26. #
  27. install:
  28. - git submodule update --init --recursive
  29. before_build:
  30. # Workaround for CMake not wanting sh.exe on PATH for MinGW
  31. - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  32. build_script:
  33. - ps: |
  34. cd c:\projects\open62541
  35. md build
  36. cd build
  37. if ($env:Compiler -eq "mingw") {
  38. if ($env:Arch -eq "x64") {
  39. echo "Testing MinGW64"
  40. $env:Path = "C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;" + $env:Path
  41. } else {
  42. echo "Testing MinGW32"
  43. $env:Path = "C:\MinGW\bin;" + $env:Path
  44. }
  45. cmake -DUA_BUILD_EXAMPLES:BOOL=ON -G"MinGW Makefiles" ..
  46. mingw32-make -j4
  47. } elseif ($env:Compiler -eq "cygwin") {
  48. echo "Testing cygwin"
  49. $env:Path = "C:\cygwin\bin;" + $env:Path
  50. C:\cygwin\bin\bash -lc "cygcheck -dc cygwin"
  51. C:\cygwin\bin\bash --login -lc "cmake.exe --version"
  52. C:\cygwin\bin\bash --login -lc "cd /cygdrive/c/projects/open62541/build; cmake -DUA_BUILD_EXAMPLES:BOOL=ON -G\"Unix Makefiles\" .."
  53. C:\cygwin\bin\bash --login -lc "cd /cygdrive/c/projects/open62541/build; make -j"
  54. } else {
  55. if ($env:Arch -eq "x64") {
  56. echo "Testing MSVC with amalgamation (x64)"
  57. cd ..
  58. md build64
  59. cd build64
  60. cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -G"Visual Studio 12 2013 Win64" ..
  61. msbuild open62541.sln /m
  62. copy C:\projects\open62541\build64\open62541.c C:\projects\open62541\build64\Debug\open62541.c
  63. copy C:\projects\open62541\build64\open62541.h C:\projects\open62541\build64\Debug\open62541.h
  64. copy C:\projects\open62541\build64\examples\server_cert.der C:\projects\open62541\build64\Debug\server_cert.der
  65. } else {
  66. echo "Testing MSVC without amalgamation (x86)"
  67. cmake -DUA_BUILD_EXAMPLES:BOOL=ON -G"Visual Studio 12 2013" ..
  68. msbuild open62541.sln /m
  69. cd ..
  70. Remove-Item .\build -Force -Recurse
  71. md build
  72. cd build
  73. echo "Testing MSVC with amalgamation (x86)"
  74. cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -G"Visual Studio 12 2013" ..
  75. msbuild open62541.sln /m
  76. copy C:\projects\open62541\build\open62541.c C:\projects\open62541\build\Debug\open62541.c
  77. copy C:\projects\open62541\build\open62541.h C:\projects\open62541\build\Debug\open62541.h
  78. copy C:\projects\open62541\build\examples\server_cert.der C:\projects\open62541\build\Debug\server_cert.der
  79. }
  80. }
  81. echo "Build done"
  82. after_build:
  83. - ps: |
  84. if ($env:Compiler -eq "msvc") {
  85. if ($env:Arch -eq "x64") {
  86. 7z a open62541-win64.zip C:\projects\open62541\build64\Debug\*
  87. appveyor PushArtifact open62541-win64.zip
  88. } else {
  89. 7z a open62541-win32.zip C:\projects\open62541\build\Debug\*
  90. appveyor PushArtifact open62541-win32.zip
  91. }
  92. }