Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition to C++11 and CI jobs covering more cases #601

Merged
merged 31 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
93a5f2a
Switch to c++11
piponazo Nov 30, 2018
427bbad
Move from auto_ptr to unique_ptr
piponazo Nov 30, 2018
a1bd52c
Remove old VS versions. Do not install ninja
piponazo Dec 2, 2018
e406ee5
Use ninja
piponazo Dec 2, 2018
8d4aa12
Different architectures and build types
piponazo Dec 2, 2018
b91f68f
Cache ninja installation
piponazo Dec 2, 2018
703cd3b
Fix compilation for 32bits
piponazo Dec 2, 2018
c0ccd91
Factor out VCVARS variable and cache deps directory
piponazo Dec 9, 2018
a0f0956
Appveyor: use configuration variable to simplify build matrix
piponazo Dec 9, 2018
7551296
Appveyor: avoid to install stuff if already present
piponazo Dec 9, 2018
f4609ca
Appveyor: Trying to simplify the platform settings
piponazo Dec 10, 2018
13f2c0a
Appveyor: SHARED and STATIC
piponazo Dec 10, 2018
952d806
travis: Many updated. See message details
piponazo Dec 10, 2018
928bd26
conan: update to gtest 1.8.1
piponazo Dec 10, 2018
cd8dad0
GTest: Simplify CMake code after updating minimum cmake version
piponazo Dec 17, 2018
d1c609b
cmake: man pages only installed with the exiv2 app
piponazo Dec 18, 2018
f733c64
appveyor: comment SHARED configuration
piponazo Dec 18, 2018
6229544
Cmake: use fake version number in master
piponazo Dec 18, 2018
f1e46d4
appveyor: set compiler.runtime depending on CONFIGURATION
piponazo Dec 18, 2018
a3bf120
appveyor: BUILD_SHARED_LIBS=ON and print profile
piponazo Dec 18, 2018
15551f9
appveyor: SHARED/STATIC
piponazo Dec 18, 2018
1583dc2
Remove unused EXV_HAVE_PROCESS_H
piponazo Dec 18, 2018
0325f0b
Remove unused EXV_HAVE_MEMORY_H
piponazo Dec 18, 2018
3bed826
Remove unused EXV_HAVE_SYS_STAT_H
piponazo Dec 18, 2018
fcb741f
Remove unused EXV_HAVE_SYS_TYPES_H
piponazo Dec 18, 2018
b372170
Remove unused EXV_HAVE_INTTYPES_H
piponazo Dec 18, 2018
77d8216
Remove unused EXV_HAVE_STDINT_H and EXV_HAVE_STDBOOL_H
piponazo Dec 18, 2018
72ebb3e
Remove unused EXV_HAVE_STRINGS_H
piponazo Dec 18, 2018
e57f311
cmake: ignore warnings about missing PDB files in 3rd party libs
piponazo Dec 18, 2018
a74c11e
Update doc: mentions to c++11 compilers
piponazo Dec 18, 2018
07e8f6e
Doc typo
piponazo Dec 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 69 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,89 @@
language: cpp

git:
quiet: true
depth: 1

env:
global:
- COMMON_CMAKE_OPTIONS="-DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_INSTALL_PREFIX=install"

matrix:
include:
- os: linux
dist: trusty
- name: "Ubuntu 16.04 - gcc-5.4 (Release)"
os: linux
dist: xenial
sudo: required
compiler: gcc
env:
- BUILD_TYPE="Release"

- name: "Ubuntu 16.04 - gcc-5.4 (Debug)"
os: linux
dist: xenial
sudo: required
compiler: gcc
env: COVERAGE=1 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DBUILD_WITH_COVERAGE=ON"
env:
- BUILD_TYPE="Debug"

- name: "Ubuntu 16.04 - gcc-5.4 with coverage"
os: linux
dist: xenial
sudo: required
compiler: gcc
env:
- WITH_COVERAGE=1
- BUILD_TYPE="Release"

- os: linux
dist: trusty
- name: "Ubuntu 16.04 - gcc-5.4 with Valgrind"
os: linux
dist: xenial
sudo: required
compiler: gcc
env:
- WITH_VALGRIND=1
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON"
- BUILD_TYPE="Release"

- name: "Ubuntu 16.04 - gcc-5.4 with sanitizers"
os: linux
dist: xenial
sudo: required
compiler: gcc
env:
- WITH_SANITIZERS=1
- BUILD_TYPE="Release"

- name: "Ubuntu 16.04 - CLANG 7.0 (Release)"
os: linux
dist: xenial
sudo: required
compiler: clang
env:
- BUILD_TYPE="Release"

- os: linux
dist: trusty
- name: "Ubuntu 16.04 - CLANG 7.0 (Debug)"
os: linux
dist: xenial
sudo: required
compiler: clang
env: CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON"
env:
- BUILD_TYPE="Debug"

- os: osx
- name: "OS X 10.12 - XCode 9.0"
os: osx
osx_image: xcode9
compiler: clang
env: PYTHON=3.6.2 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_NLS=OFF"
env:
- PYTHON=3.6.2
- BUILD_TYPE="Release"

- name: "OS X 10.13 - XCode 10.1"
os: osx
osx_image: xcode10.1
compiler: clang
env:
- PYTHON=3.6.2
- BUILD_TYPE="Release"

install: ./ci/install.sh
script: ./ci/run.sh
Expand Down
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required( VERSION 3.3.2 )
cmake_minimum_required( VERSION 3.5.0 )

project(exiv2
VERSION 0.27.0.3
VERSION 0.27.99.0 # Fake version number to indicate that the next version will be 28.0
LANGUAGES CXX C
)

Expand Down Expand Up @@ -106,6 +106,3 @@ configure_file(cmake/exiv2.pc.in exiv2.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/exiv2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

include(cmake/printSummary.cmake)

# That's all Folks!
##
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| [![Build Status](https://travis-ci.org/Exiv2/exiv2.svg?branch=master)](https://travis-ci.org/Exiv2/exiv2) | [![Build status](https://ci.appveyor.com/api/projects/status/d6vxf2n0cp3v88al/branch/master?svg=true)](https://ci.appveyor.com/project/piponazo/exiv2-wutfp/branch/master) | [![pipeline status](https://gitlab.com/D4N/exiv2/badges/master/pipeline.svg)](https://gitlab.com/D4N/exiv2/commits/master) | [![codecov](https://codecov.io/gh/Exiv2/exiv2/branch/master/graph/badge.svg)](https://codecov.io/gh/Exiv2/exiv2) |

<name id="TOC">
### T A B L E _ OF _ C O N T E N T S
### TABLE OF CONTENTS

1. [Welcome to Exiv2](#1)
2. [Building, Installing, Using and Uninstalling Exiv2](#2)
Expand Down Expand Up @@ -56,7 +56,7 @@ The file ReadMe.txt in a Build bundle describes how to install the library on th
<name id="2">
## 2 Building, Installing, Using and Uninstalling Exiv2

You need CMake to build Exiv2: https://cmake.org/download/
You need [CMake](https://cmake.org/download/) to configure the Exiv2 project and a C++11 compiler.

<name id="2-1">
### 2.1 Build, Install, Use, Uninstall Exiv2 on a UNIX-like system
Expand Down Expand Up @@ -136,14 +136,15 @@ The following Exiv2 features are enabled by default and require external librari
| Native language support | gettext | -DEXIV2\_ENABLE\_NLS=Off | [http://www.gnu.org/software/gettext/](http://www.gnu.org/software/gettext/) |
| XMP support | expat | -DEXIV2\_ENABLE\_XMP=Off | [http://expat.sourceforge.net](http://expat.sourceforge.net)/<br/>Use _**Expat 2.2.6**_ and later |

On Linux, you may install the dependencies using the distribution's package management system. Install the development package of a dependency to install the header files and static libraries required to build Exiv2.
On Linux, you may install the dependencies using the distribution's package management system. Install the development package of a dependency to install the header files and static libraries required to build Exiv2.

Notes about different platforms are included in this document: [Platform Notes](#5)

You may choose to install dependences with conan. This is supported on all platforms and is especially useful for users of Visual Studio.
See [README-CONAN](README-CONAN.md) for more information.

[TOC](#TOC)

<name id="2-5">
### 2.5 Building and linking your code with Exiv2

Expand All @@ -153,7 +154,7 @@ platform: { CYGWIN| Darwin | Linux | MinGW | msvc }

In general you need to do the following:

1) Application code should be written in C++ 98 and include exiv2 headers:
1) Application code should be written in C++11 and include exiv2 headers:

```C++
#include <exiv2/exiv2.hpp>
Expand All @@ -166,7 +167,7 @@ In general you need to do the following:
The following is a typical command to build and link with libexiv2:

```bash
$ g++ -std=c++98 myprog.cpp -o myprog -I/usr/local/include -L/usr/local/lib -lexiv2
$ g++ -std=c++11 myprog.cpp -o myprog -I/usr/local/include -L/usr/local/lib -lexiv2
```

[TOC](#TOC)
Expand Down Expand Up @@ -775,7 +776,7 @@ bash.exe -norc
<name id="5-5">
### 5.5 Microsoft Visual C++

We recommend that you use Conan to build Exiv2 using Microsoft Visual C++. For v0.27, we support Visual Studio 2008, 2010, 2012, 2013, 2015 and 2017.
We recommend that you use Conan to build Exiv2 using Microsoft Visual C++. Since we require a C++11 compiler, we only support the Visual Studio versions 2015 and 2017.

As well as Microsoft Visual Studio, you will need to install CMake, Python3, and Conan.

Expand All @@ -795,4 +796,4 @@ cmd

[TOC](#TOC)

Written by Robin Mills<br>[email protected]<br>Updated: 2018-12-01
Written by Robin Mills<br>[email protected]<br>Updated: 2018-12-18
99 changes: 35 additions & 64 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,69 @@
image: Visual Studio 2017

configuration:
- Debug
- Release

platform:
- x86
- x64

environment:
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat

matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
CMAKE_GENERATOR: Visual Studio 9 2008
INTEGRATION_TESTS: 0
VS_COMPILER_VERSION: 9
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
ARCHITECTURE: x86
UNIT_TESTS: 0
WARNINGS_AS_ERRORS: OFF
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
CMAKE_GENERATOR: Visual Studio 10 2010
INTEGRATION_TESTS: 0
VS_COMPILER_VERSION: 10
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
ARCHITECTURE: x86
UNIT_TESTS: 0
WARNINGS_AS_ERRORS: OFF
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
CMAKE_GENERATOR: Visual Studio 11 2012 Win64
INTEGRATION_TESTS: 0
VS_COMPILER_VERSION: 11
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
CMAKE_GENERATOR: Visual Studio 12 2013 Win64
INTEGRATION_TESTS: 0
VS_COMPILER_VERSION: 12
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: Visual Studio 14 2015 Win64
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 14
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Visual Studio 15 2017 Win64
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 15
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- SHARED: ON
- SHARED: OFF

shallow_clone: true

install:
- echo %APPVEYOR_BUILD_FOLDER%
- mkdir C:\projects\deps
- cd C:\projects\deps
- appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip -FileName ninja.zip
- 7z x ninja.zip -oC:\projects\deps\ninja > nul
- set PATH=C:\projects\deps\ninja;%PATH%
- ninja --version
- if not exist deps mkdir deps
- cd deps
- if not exist ninja appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip -FileName ninja.zip
- if not exist ninja 7z x ninja.zip -o%APPVEYOR_BUILD_FOLDER%\deps\ninja > nul
- set PATH=%APPVEYOR_BUILD_FOLDER%\deps\ninja;%PATH%

before_build:
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: if not exist envs mkdir envs
- cmd: cd envs
- cmd: python -m virtualenv conan
- cmd: if not exist conan python -m virtualenv conan
- cmd: conan/Scripts/activate
- cmd: python -m pip install conan==1.9.0
- cmd: if not exist conan/Scripts/conan.exe python -m pip install conan==1.9.0
- cmd: cd ..
- cmd: conan --version
- cmd: conan remote add conan-bincrafters https://api.bintray.com/conan/bincrafters/public-conan
- cmd: conan remote list
- cmd: conan config set storage.path=c:\Users\appveyor\conanCache
- cmd: conan profile new --detect default
- cmd: conan profile update settings.compiler.version=%VS_COMPILER_VERSION% default
- cmd: conan profile update settings.compiler.version=15 default
- cmd: if "%platform%"=="x64" (set ARCHITECTURE=x86_64) else (set ARCHITECTURE=x86)
- cmd: if "%CONFIGURATION%"=="Debug" (set RUNTIME=MDd) else (set RUNTIME=MD)
- cmd: conan profile update settings.arch=%ARCHITECTURE% default
- cmd: conan profile update settings.arch_build=%ARCHITECTURE% default
- cmd: conan profile update settings.build_type=%CONFIGURATION% default
- cmd: conan profile update settings.compiler.runtime=%RUNTIME% default
- cmd: cat c:\Users\appveyor\.conan\conan.conf
- cmd: cat c:\Users\appveyor\.conan\profiles\default

build_script:
- cmd: md build
- cmd: cd build
- cmd: call "%VCVARS%" x86_amd64
- cmd: if "%platform%"=="x64" (set VC_ARCH=x86_amd64) else (set VC_ARCH=x86)
- cmd: call "%VCVARS%" %VC_ARCH%
- cmd: conan install .. --build missing
- cmd: echo %CMAKE_GENERATOR%
- cmd: cmake -G "%CMAKE_GENERATOR%" -DEXIV2_TEAM_WARNINGS_AS_ERRORS=%WARNINGS_AS_ERRORS% -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_BUILD_UNIT_TESTS=%UNIT_TESTS% -DCMAKE_INSTALL_PREFIX=install ..
- cmd: cmake --build . --config Release
- cmd: cmake --build . --config Release --target install
- cmd: cmake -GNinja -DBUILD_SHARED_LIBS=%SHARED% -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_BUILD_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX=install ..
- cmd: ninja
- cmd: ninja install
- cmd: cd bin
- cmd: if %UNIT_TESTS% == 1 unit_tests.exe
- cmd: unit_tests.exe
- cmd: cd ../../tests/
- cmd: set EXIV2_EXT=.exe
- cmd: if %INTEGRATION_TESTS% == 1 c:\Python36\python.exe runner.py -v
- cmd: c:\Python36\python.exe runner.py -v

cache:
- envs # Conan installation
- deps # Ninja installation
- c:\Users\appveyor\conanCache # Conan cache
12 changes: 3 additions & 9 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -x # Prints every command

if [[ "$(uname -s)" == 'Linux' ]]; then
sudo apt-get update
sudo apt-get install cmake zlib1g-dev libssh-dev python-pip libxml2-utils
sudo apt-get install libssh-dev python-pip libxml2-utils
if [ -n "$WITH_VALGRIND" ]; then
sudo apt-get install valgrind
fi
Expand Down Expand Up @@ -34,14 +34,8 @@ pip install conan==1.9.0
pip install codecov
conan --version
conan config set storage.path=~/conanData
conan remote add conan-bincrafters https://api.bintray.com/conan/bincrafters/public-conan

mkdir -p ~/.conan/profiles
conan profile new default --detect

if [[ "$(uname -s)" == 'Linux' ]]; then
CC_VER=$(${CC} --version | head -1 | awk '{print $3}'| awk -F'.' '{ print $1"."$2 }')
printf "[settings]\nos=Linux\narch=x86_64\ncompiler=$CC\ncompiler.version=$CC_VER\ncompiler.libcxx=libstdc++\nbuild_type=Release\n" > ~/.conan/profiles/release
else
printf "[settings]\nos=Macos\narch=x86_64\ncompiler=apple-clang\ncompiler.version=9.0\ncompiler.libcxx=libc++\nbuild_type=Release\n" > ~/.conan/profiles/release
conan profile update settings.compiler.libcxx=libstdc++11 default
fi

Loading