platform:
    - x64

environment:
    global:
        CYG_ROOT: C:/cygwin64
        CYG_CACHE: C:/cygwin64/var/cache/setup
        CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
    matrix:
        - CYG_ARCH: x86_64

install:
    - 'appveyor DownloadFile http://cygwin.com/setup-%CYG_ARCH%.exe -FileName setup.exe'
    - 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P make -P gcc-core >NUL'
    - 'cinst winpcap'
    - 'appveyor DownloadFile http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip'
    - 'dir'
    - '7z x .\WpdPack_4_1_2.zip -o.'
    - 'xcopy .\WpdPack\Lib\x64\*.* C:\cygwin64\lib\'

build_script:
    - '%CYG_ROOT%/bin/bash -lc "ls $APPVEYOR_BUILD_FOLDER'
    - '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER && make CFLAGS=\"-O3 -Wall -IWpdPack\\Include\"'
    - 'copy C:\cygwin64\bin\cygwin1.dll %APPVEYOR_BUILD_FOLDER%'


artifacts:
  - path: 'ubridge.exe'
  - path: 'cygwin1.dll'
