From 01fce1781ee96d75f8569061274d6be53a7412e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Mon, 23 May 2016 01:29:55 +0200 Subject: [PATCH] Add appveyor.yml and attempt of windows build --- .travis.yml | 2 +- appveyor.yml | 15 +++++++++++++++ ci/compile.sh | 11 ++++++++++- ci/execute.sh | 14 ++++++++++++++ ci/{update_travis.sh => update_ci.sh} | 12 ++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 appveyor.yml rename ci/{update_travis.sh => update_ci.sh} (59%) diff --git a/.travis.yml b/.travis.yml index 1383c0e..9f81098 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ services: - docker before_install: - - ./ci/update_travis.sh + - ./ci/update_ci.sh script: - script=compile CXX=clang++ CC=clang ./ci/execute.sh diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..2e3274a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,15 @@ +platform: + - x86 + - x64 + +before_build: + - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman + - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh git + - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade + +build_script: + - C:\msys64\usr\bin\bash -lc "script=compile CXX=clang++ CC=clang $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=clean $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=static_analysis $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile make_command=\"broadwayd & make test\" $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" diff --git a/ci/compile.sh b/ci/compile.sh index 9a072b0..aac3547 100755 --- a/ci/compile.sh +++ b/ci/compile.sh @@ -1,7 +1,16 @@ #!/bin/bash if [ "${cmake_command}" == "" ]; then - cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + if [ $APPVEYOR ]; then + if [ "$PLATFORM" == "x64" ]; then + mingw="mingw64" + else + mingw="mingw32" + fi + cmake_command="cmake -G\"MSYS Makefiles\" -DCMAKE_INSTALL_PREFIX=/${mingw} .. -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + else + cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + fi fi if [ "${make_command}" == "" ]; then diff --git a/ci/execute.sh b/ci/execute.sh index a90cee5..0cfdc76 100755 --- a/ci/execute.sh +++ b/ci/execute.sh @@ -22,4 +22,18 @@ function osx () { true } +function windows () { + cd "$(dirname "$0")" || exit + if [ "${script}" == "clean" ]; then + sudo rm ./build -rf + return 0 + fi + sh -c "./ci/${script}.sh" +} + + +if [ "$TRAVIS_OS_NAME" == "" ]; then + TRAVIS_OS_NAME=windows +fi + $TRAVIS_OS_NAME diff --git a/ci/update_travis.sh b/ci/update_ci.sh similarity index 59% rename from ci/update_travis.sh rename to ci/update_ci.sh index 8969bae..693b2c2 100755 --- a/ci/update_travis.sh +++ b/ci/update_ci.sh @@ -19,4 +19,16 @@ function osx () { brew install cmake pkg-config boost homebrew/x11/gtksourceviewmm3 aspell clang-format } +function windows () { + arch=x86_64 + if [ "$PLATFORM" == "x86" ]; then + arch=i686 + fi + sh -c "pacman -S git mingw-w64-${arch}-cmake make mingw-w64-${arch}-toolchain mingw-w64-${arch}-clang mingw-w64-${arch}-gtkmm3 mingw-w64-${arch}-gtksourceviewmm3 mingw-w64-${arch}-boost mingw-w64-${arch}-aspell mingw-w64-${arch}-aspell-en" +} + +if [ "$TRAVIS_OS_NAME" == "" ]; then + TRAVIS_OS_NAME=windows +fi + $TRAVIS_OS_NAME \ No newline at end of file