aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml13
-rw-r--r--.travis.yml35
2 files changed, 31 insertions, 17 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 725adc8c..701028af 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,7 +1,7 @@
image: Visual Studio 2017
environment:
- #DEPLOY_DIR: quotient-%APPVEYOR_BUILD_VERSION%
+ CMAKE_ARGS: '-G "NMake Makefiles JOM" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo'
matrix:
- QTDIR: C:\Qt\5.13\msvc2017_64
VCVARS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat"
@@ -19,17 +19,14 @@ init:
before_build:
- git submodule update --init --recursive
- git clone https://gitlab.matrix.org/matrix-org/olm.git
-- cd olm
-- cmake -G "NMake Makefiles JOM" -H. -Bbuild -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install
-- cmake --build build
-- cmake --build build --target install
-- cd ..
-- cmake -G "NMake Makefiles JOM" -H. -Bbuild -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="%DEPLOY_DIR%" -DOlm_DIR="olm/install/lib/cmake/Olm"
+- cmake %CMAKE_ARGS% -Holm -Bbuild/olm
+- cmake --build build/olm
build_script:
+- cmake %CMAKE_ARGS% -H. -Bbuild "-DOlm_DIR=build/olm"
- cmake --build build
# qmake uses olm just built by CMake - it can't build olm on its own.
-- qmake "INCLUDEPATH += olm/install/include" "LIBS += -Lbuild" "LIBS += -Lolm/install/lib" && jom
+- qmake "INCLUDEPATH += olm/include" "LIBS += -Lbuild" "LIBS += -Lbuild/olm" && jom
#after_build:
#- cmake --build build --target install
diff --git a/.travis.yml b/.travis.yml
index 5cd45ac7..db92dc59 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,17 @@ addons:
- qtmultimedia5-dev
- valgrind
+env:
+ global:
+ - DESTDIR="$TRAVIS_BUILD_DIR/install"
+ - CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=$DESTDIR/usr"
+ - VALGRIND_OPTIONS="--tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=.valgrind.qmc-example.supp"
+ # RPM spec-style: swallow a command with default parameters into a variable
+ # and add/override parameters further in the code if/as necessary
+ - _CMAKE_CONFIG="cmake $CMAKE_ARGS . -Bbuild"
+ - _CMAKE_BUILD="cmake --build build"
+ - _CMAKE_BUILD_INSTALL="$_CMAKE_BUILD --target install"
+
matrix:
include:
- os: linux
@@ -36,15 +47,22 @@ matrix:
before_install:
- eval "${ENV_EVAL}"
-- export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_PREFIX_PATH=../install -DCMAKE_INSTALL_PREFIX=../install"
+#- export DESTDIR=$TRAVIS_BUILD_DIR/install
+#- export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_PREFIX_PATH=${DESTDIR}/install"
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; fi
+# RPM spec-style: swallow a command with default parameters into a variable
+# and add/override parameters further in the code if/as necessary
+#- export _CMAKE_CONFIG="cmake $CMAKE_ARGS . -Bbuild"
+#- export _CMAKE_BUILD="cmake --build build"
+#- export _CMAKE_BUILD_INSTALL="$_CMAKE_BUILD --target install"
+
install:
- git clone https://gitlab.matrix.org/matrix-org/olm.git
- pushd olm
-- cmake . -Bbuild -DBUILD_SHARED_LIBS=NO $CMAKE_ARGS
-- cmake --build build --target install
+- $_CMAKE_CONFIG -DBUILD_SHARED_LIBS=NO
+- $_CMAKE_BUILD_INSTALL
- popd
- git clone https://github.com/quotient-im/matrix-doc.git
- git clone --recursive https://github.com/KitsuneRal/gtad.git
@@ -54,17 +72,16 @@ install:
- popd
before_script:
-- cmake . -Bbuild -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" $CMAKE_ARGS
-- cmake --build build --target update-api
+- $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad"
+- $_CMAKE_BUILD --target update-api
script:
-- cmake --build build --target all
-- cmake --build build --target install
+- $_CMAKE_BUILD_INSTALL
# Build qmc-example with the installed library
-- cmake examples -Bbuild-example $CMAKE_ARGS
+- cmake $CMAKE_ARGS examples -Bbuild-example
- cmake --build build-example --target all
# Build with qmake
-- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/install/lib"
+- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += $DESTDIR/include" "LIBS += -Lbuild/lib" "LIBS += -L$DESTDIR/lib"
- make all
# Run the qmake-compiled qmc-example under valgrind
- if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="build/lib" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi