diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000000..1db63a2478b --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,57 @@ +branches: + only: + - master + - windows + - windows-rebased + +cache: + - '%APPVEYOR_BUILD_FOLDER%\build' + +environment: + global: + MSYS2_ROOT: C:\msys64 + CONDA_INSTALL_LOCN: C:\\Miniconda36-x64 + PYTHON2_LOCN: C:\\Python27-x64 + APPVEYOR_SAVE_CACHE_ON_FAILURE: true + +platform: + - x64 + +install: + # Add path, activate `conda` and update conda. + - cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat + - cmd: conda update --yes --quiet conda + # Add our channels. + - cmd: conda config --add channels defaults + - cmd: conda config --add channels conda-forge + - cmd: conda install --yes --quiet flang-meta llvmdev clangdev openmp cmake + - cmd: set "PATH=%PYTHON2_LOCN%\Scripts;%PYTHON2_LOCN%;%PATH%" + - ps: pip install lit + + +build_script: + - mkdir build + - cd build + - set "PATH=%cd%\bin;%PATH%" + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 + - ps: | + cmake -G "NMake Makefiles" -DFLANG_INCLUDE_TESTS=ON -DFLANG_TEST_VERBOSE_MODE=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release .. + Push-AppveyorArtifact .\CMakeFiles\CMakeOutput.log + Push-AppveyorArtifact .\CMakeFiles\CMakeError.log + - ps: | + cmake --build . 2>&1 | Out-File build_output.txt + if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) } + Push-AppveyorArtifact .\build_output.txt + Get-Content .\build_output.txt -Tail 500 + - ps: Compress-Archive -Path C:\projects\flang\build\bin -DestinationPath C:\Projects\flang\bin.zip + - ps: Push-AppveyorArtifact C:\Projects\flang\bin.zip + - ps: Compress-Archive -Path C:\projects\flang\build\lib -DestinationPath C:\Projects\flang\lib.zip + - ps: Push-AppveyorArtifact C:\Projects\flang\lib.zip + +test_script: + - cmd: set "PATH=%PATH%;%MSYS2_ROOT%\usr\bin\" + - cmd: copy lib\flangmain.lib %CONDA_INSTALL_LOCN%\Library\lib + - cmd: copy lib\flangrti.lib %CONDA_INSTALL_LOCN%\Library\lib + - cmd: copy lib\flang.lib %CONDA_INSTALL_LOCN%\Library\lib + - cmd: copy lib\ompstub.lib %CONDA_INSTALL_LOCN%\Library\lib + - cmd: nmake check-flang