2018-08-05 22:30:52 +02:00
|
|
|
language: c
|
|
|
|
|
|
|
|
# Platform descriptions
|
|
|
|
# NOTE: These can be used in creating the build matrix by making use of the
|
|
|
|
# anchor/alias YAML features.
|
|
|
|
linux_gcc8: &linux_gcc8
|
|
|
|
os: linux
|
2019-01-31 18:09:49 +01:00
|
|
|
dist: xenial
|
2018-08-05 22:30:52 +02:00
|
|
|
compiler: gcc
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
update: true
|
|
|
|
sources: [ ubuntu-toolchain-r-test ]
|
2019-01-31 18:09:49 +01:00
|
|
|
packages: [ gcc-8 g++-8 ]
|
2018-08-05 22:30:52 +02:00
|
|
|
|
2019-01-31 18:09:49 +01:00
|
|
|
linux_clang: &linux_clang
|
2018-08-05 22:30:52 +02:00
|
|
|
os: linux
|
2019-01-31 18:09:49 +01:00
|
|
|
dist: xenial
|
2018-08-05 22:30:52 +02:00
|
|
|
compiler: clang
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
update: true
|
|
|
|
|
2019-01-31 18:09:49 +01:00
|
|
|
osx_xcode10_1: &osx_xcode10_1
|
2018-08-05 22:30:52 +02:00
|
|
|
os: osx
|
2019-01-31 18:09:49 +01:00
|
|
|
osx_image: xcode10.1
|
2018-08-05 22:30:52 +02:00
|
|
|
compiler: clang
|
2019-01-31 18:09:49 +01:00
|
|
|
addons:
|
|
|
|
homebrew:
|
|
|
|
packages:
|
|
|
|
- pyenv-virtualenv
|
2018-08-05 22:30:52 +02:00
|
|
|
|
2019-02-17 23:41:37 +01:00
|
|
|
windows_vs2017: &windows_vs2017
|
|
|
|
os: windows
|
|
|
|
|
2018-08-05 22:30:52 +02:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- <<: *linux_gcc8
|
2019-01-18 14:19:22 +01:00
|
|
|
env: [ BUILD_TYPE=Debug, C_COMPILER=gcc-8, CXX_COMPILER=g++-8, USE_SANITIZER=none ]
|
2018-08-05 22:30:52 +02:00
|
|
|
- <<: *linux_gcc8
|
2019-01-18 14:19:22 +01:00
|
|
|
env: [ BUILD_TYPE=Release, C_COMPILER=gcc-8, CXX_COMPILER=g++-8, USE_SANITIZER=none ]
|
2019-01-31 18:09:49 +01:00
|
|
|
- <<: *linux_clang
|
|
|
|
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
|
|
|
- <<: *linux_clang
|
2019-02-17 23:41:37 +01:00
|
|
|
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
2019-01-31 18:09:49 +01:00
|
|
|
- <<: *osx_xcode10_1
|
2019-01-18 14:19:22 +01:00
|
|
|
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
2019-01-31 18:09:49 +01:00
|
|
|
- <<: *osx_xcode10_1
|
2019-01-18 14:19:22 +01:00
|
|
|
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
2019-02-17 23:41:37 +01:00
|
|
|
- <<: *windows_vs2017
|
|
|
|
env: [ ARCH=x86, BUILD_TYPE=Debug, GENERATOR="Visual Studio 15 2017" ]
|
|
|
|
- <<: *windows_vs2017
|
|
|
|
env: [ ARCH=x86_64, BUILD_TYPE=Debug, GENERATOR="Visual Studio 15 2017" ]
|
|
|
|
- <<: *windows_vs2017
|
|
|
|
env: [ ARCH=x86_64, BUILD_TYPE=Release, GENERATOR="Visual Studio 15 2017" ]
|
2018-08-05 22:30:52 +02:00
|
|
|
|
2019-02-17 23:41:37 +01:00
|
|
|
# Conan will automatically determine the best compiler for a given platform
|
|
|
|
# based on educated guesses. The first check is based on the CC and CXX
|
|
|
|
# environment variables, the second (on Windows) is to check if Microsoft
|
|
|
|
# Visual Studio is installed. On Travis CC and CXX are set to gcc on Microsoft
|
|
|
|
# Windows targets as well, this has the undesired effect that MSVC is not
|
|
|
|
# detected, unsetting CC and CXX solves that problem.
|
2018-08-05 22:30:52 +02:00
|
|
|
before_install:
|
2019-02-17 23:41:37 +01:00
|
|
|
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
|
|
|
|
eval "unset CC";
|
|
|
|
eval "unset CXX";
|
2019-04-18 17:34:14 +02:00
|
|
|
JAVA_HOME=$(find "/c/Program Files/Android/jdk/" -name "*openjdk*" | sort | head -n 1);
|
|
|
|
export JAVA_HOME;
|
|
|
|
export PATH="${PATH}:${JAVA_HOME}/bin";
|
2019-02-17 23:41:37 +01:00
|
|
|
else
|
|
|
|
eval "export CC=${C_COMPILER}";
|
|
|
|
eval "export CXX=${CXX_COMPILER}";
|
|
|
|
fi
|
2018-08-05 22:30:52 +02:00
|
|
|
|
2019-02-17 23:41:37 +01:00
|
|
|
# Windows targets in Travis are still very much in beta and Python is not yet
|
|
|
|
# available and installation of Python through Chocolaty does not work well.
|
|
|
|
# The real fix is to wait until Python and pip are both available on the
|
|
|
|
# target. Until then download Conan from the official website and simply add
|
|
|
|
# the extracted folder to the path.
|
2018-08-05 22:30:52 +02:00
|
|
|
install:
|
2019-02-17 23:41:37 +01:00
|
|
|
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
|
2019-04-18 17:34:14 +02:00
|
|
|
choco install innoextract;
|
|
|
|
choco install maven --ignore-dependencies;
|
2019-02-17 23:41:37 +01:00
|
|
|
wget -q https://dl.bintray.com/conan/installers/conan-win-64_1_10_0.exe;
|
|
|
|
innoextract conan-win-64_1_10_0.exe;
|
|
|
|
eval "export PATH=\"$(pwd)/app/conan:${PATH}\"";
|
|
|
|
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
2018-08-05 22:30:52 +02:00
|
|
|
eval "$(pyenv init -)";
|
|
|
|
pyenv virtualenv conan;
|
|
|
|
pyenv rehash;
|
|
|
|
pyenv activate conan;
|
|
|
|
pip install conan --upgrade;
|
|
|
|
else
|
|
|
|
pip install conan --upgrade --user;
|
|
|
|
fi
|
2019-02-17 23:41:37 +01:00
|
|
|
- conan profile new default --detect
|
2018-08-05 22:30:52 +02:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
|
2019-02-17 23:41:37 +01:00
|
|
|
- conan profile get settings.arch default
|
|
|
|
- if [ -z "${ARCH}" ]; then
|
|
|
|
eval "export ARCH=\"$(conan profile get settings.arch default)\"";
|
|
|
|
fi
|
|
|
|
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
|
|
|
|
GENERATOR_ARCH=$(if [ "${ARCH}" = "x86_64" ]; then echo " Win64"; fi);
|
|
|
|
eval "export GENERATOR=\"${GENERATOR}${GENERATOR_ARCH}\"";
|
|
|
|
eval "export USE_SANITIZER=none";
|
|
|
|
else
|
|
|
|
eval "export GENERATOR=\"Unix Makefiles\"";
|
|
|
|
fi
|
|
|
|
- export
|
2018-08-05 22:30:52 +02:00
|
|
|
|
|
|
|
script:
|
|
|
|
- mkdir build
|
|
|
|
- cd build
|
2019-02-17 23:41:37 +01:00
|
|
|
- conan install -b missing -s arch=${ARCH} -s build_type=${BUILD_TYPE} ..
|
|
|
|
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
|
|
|
-DCMAKE_INSTALL_PREFIX=$(pwd)/install
|
|
|
|
-DUSE_SANITIZER=${USE_SANITIZER}
|
|
|
|
-DBUILD_TESTING=on
|
|
|
|
-G "${GENERATOR}" ../src
|
|
|
|
- cmake --build . --config ${BUILD_TYPE} --target install
|
2019-03-23 13:48:40 +01:00
|
|
|
- CYCLONEDDS_URI='<CycloneDDS><DDSI2E><Internal><EnableExpensiveChecks>all</EnableExpensiveChecks></Internal></DDSI2E></CycloneDDS>' ctest -T test -C ${BUILD_TYPE}
|
2019-02-17 23:41:37 +01:00
|
|
|
- if [ "${USE_SANITIZER}" != "none" ]; then
|
|
|
|
CMAKE_LINKER_FLAGS="-DCMAKE_LINKER_FLAGS=-fsanitize=${USE_SANITIZER}";
|
|
|
|
CMAKE_C_FLAGS="-DCMAKE_C_FLAGS=-fsanitize=${USE_SANITIZER}";
|
2019-01-18 14:19:22 +01:00
|
|
|
fi
|
2019-02-17 23:41:37 +01:00
|
|
|
- mkdir install/share/CycloneDDS/examples/helloworld/build
|
|
|
|
- cd install/share/CycloneDDS/examples/helloworld/build
|
|
|
|
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
|
|
|
${CMAKE_C_FLAGS}
|
|
|
|
${CMAKE_LINKER_FLAGS}
|
|
|
|
-G "${GENERATOR}" ..
|
|
|
|
- cmake --build . --config ${BUILD_TYPE}
|
|
|
|
|