Merge pull request #1367 from Exiv2/027_travisUbuntuDistros

027 - Add more ubuntu distros to Travis CI and fix cmake variable passing
This commit is contained in:
Robin Mills 2020-10-17 17:44:00 +01:00 committed by GitHub
commit 261457b889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 7 deletions

View File

@ -26,6 +26,38 @@ matrix:
env:
- BUILD_TYPE="Debug"
- name: "Ubuntu 18.04 - gcc (Release)"
os: linux
dist: bionic
sudo: required
compiler: gcc
env:
- BUILD_TYPE="Release"
- name: "Ubuntu 18.04 - gcc (Debug)"
os: linux
dist: bionic
sudo: required
compiler: gcc
env:
- BUILD_TYPE="Debug"
- name: "Ubuntu 20.04 - gcc (Release)"
os: linux
dist: focal
sudo: required
compiler: gcc
env:
- BUILD_TYPE="Release"
- name: "Ubuntu 20.04 - gcc (Debug)"
os: linux
dist: focal
sudo: required
compiler: gcc
env:
- BUILD_TYPE="Debug"
- name: "Ubuntu 16.04 - gcc-5.4 with coverage"
os: linux
dist: xenial

View File

@ -2,12 +2,21 @@
set -e # Enables cheking of return values from each command
set -x # Prints every command
# This file is only used from Travis CI, where the only Linux distro used is Ubuntu
python --version
python3 --version
if [[ "$(uname -s)" == 'Linux' ]]; then
sudo apt-get update
sudo apt-get install cmake zlib1g-dev libssh-dev python-pip libxml2-utils
if [[ "$(lsb_release -cs)" == 'focal' ]]; then
# In Ubuntu 20.04 python-pip does not exist. Furthermore we need to have the alias python for python3
sudo apt-get install cmake zlib1g-dev libssh-dev python3-pip python-is-python3 libxml2-utils
else
sudo apt-get install cmake zlib1g-dev libssh-dev python-pip libxml2-utils
fi
if [ -n "$WITH_VALGRIND" ]; then
sudo apt-get install valgrind
fi

View File

@ -8,21 +8,21 @@ source conan/bin/activate
if [[ "$(uname -s)" == 'Linux' ]]; then
if [ "$CC" == "clang" ]; then
# clang + Ubuntu don't like to run with UBSAN, but ASAN works
export CMAKE_OPTIONS="$CMAKE_OPTIONS"
export CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS"
elif [ -n "$WITH_VALGRIND" ]; then
export EXIV2_VALGRIND="valgrind --quiet"
else
export CMAKE_OPTIONS="$CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF"
export CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF"
fi
else
export CMAKE_OPTIONS="$CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF"
export CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF"
fi
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_CXX_FLAGS=-Wno-deprecated"
CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS -DCMAKE_CXX_FLAGS=-Wno-deprecated -DCMAKE_CXX_STANDARD=98 -DCMAKE_BUILD_TYPE=$BUILD_TYPE"
mkdir build
cd build
conan install .. -o webready=True --build missing
cmake ${CMAKE_OPTIONS} -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_INSTALL_PREFIX=install ..
cmake ${CMAKE_OPTIONS} ..
make -j
make tests
make install

View File

@ -79,7 +79,7 @@ static char* find_chars_or_comment(const char* s, const char* chars)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size)
{
strncpy(dest, src, size);
memcpy(dest, src, size);
dest[size - 1] = '\0';
return dest;
}