[Appveyor] Build exiv2 with Visual Studio 2012 and 2013
- Integration tests had to be disabled with 2012 and 2013. There were few (4) tests failing for these cases. - Only bring libiconv with conan when a windows subsystem is detected. - libiconv can be enabled now with a conan option. - Use infinity instead of INFINITY - Use conan_basic_setup(). Fixes a problem with gtest is VS2012 - call vcvarsall.bat for each compiler version so that nmake can be found.
This commit is contained in:
parent
2ae0cffe18
commit
24be5a514e
24
appveyor.yml
24
appveyor.yml
@ -1,11 +1,25 @@
|
||||
environment:
|
||||
matrix:
|
||||
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
#CMAKE_GENERATOR: Visual Studio 12 2013 Win64
|
||||
- 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
|
||||
- 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
|
||||
- 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
|
||||
- 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
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
@ -31,21 +45,25 @@ before_build:
|
||||
- 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: cat c:\Users\appveyor\.conan\conan.conf
|
||||
|
||||
build_script:
|
||||
- cmd: md build
|
||||
- cmd: cd build
|
||||
- cmd: call "%VCVARS%" x86_amd64
|
||||
- cmd: conan install .. --build missing
|
||||
- cmd: echo %CMAKE_GENERATOR%
|
||||
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX=install ..
|
||||
- cmd: cmake --build . --config Release
|
||||
- cmd: cmake --build . --config Release --target install
|
||||
|
||||
after_build:
|
||||
- cmd: cd bin
|
||||
- cmd: unit_tests.exe
|
||||
- cmd: cd ../../tests/
|
||||
- cmd: set EXIV2_EXT=.exe
|
||||
- cmd: c:\Python36\python.exe runner.py -v
|
||||
- cmd: if %INTEGRATION_TESTS% == "1" c:\Python36\python.exe runner.py -v
|
||||
|
||||
cache:
|
||||
- envs # Conan installation
|
||||
|
||||
@ -5,7 +5,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
||||
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
set(USING_CONAN ON)
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_set_find_paths()
|
||||
conan_basic_setup(NO_OUTPUT_DIRS KEEP_RPATHS)
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
@ -6,9 +6,11 @@ class Exiv2Conan(ConanFile):
|
||||
generators = 'cmake'
|
||||
options = {'unitTests': [True, False],
|
||||
'xmp': [True, False],
|
||||
'iconv': [True, False],
|
||||
}
|
||||
default_options = ('unitTests=True',
|
||||
'xmp=False',
|
||||
'iconv=False',
|
||||
)
|
||||
|
||||
def configure(self):
|
||||
@ -20,8 +22,9 @@ class Exiv2Conan(ConanFile):
|
||||
self.requires('zlib/1.2.11@conan/stable')
|
||||
self.requires('libcurl/7.60.0@bincrafters/stable')
|
||||
|
||||
if os_info.is_windows:
|
||||
self.requires('libiconv/1.15@bincrafters/stable')
|
||||
if os_info.is_windows and self.options.xmp:
|
||||
if os_info.detect_windows_subsystem() in ("cygwin", "msys2"):
|
||||
self.requires('libiconv/1.15@bincrafters/stable')
|
||||
|
||||
if self.options.unitTests:
|
||||
self.requires('gtest/1.8.0@bincrafters/stable')
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include <exiv2/types.hpp>
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
#include "gtestwrapper.h"
|
||||
|
||||
@ -50,11 +51,11 @@ TEST(Rational, floatToRationalCast)
|
||||
ASSERT_TRUE(fabs((floats[i] - fraction) / floats[i]) < 0.01f);
|
||||
}
|
||||
|
||||
const Rational plus_inf = floatToRationalCast(INFINITY);
|
||||
const Rational plus_inf = floatToRationalCast(std::numeric_limits<float>::infinity());
|
||||
ASSERT_EQ(plus_inf.first, 1);
|
||||
ASSERT_EQ(plus_inf.second, 0);
|
||||
|
||||
const Rational minus_inf = floatToRationalCast(-1 * INFINITY);
|
||||
const Rational minus_inf = floatToRationalCast(-1 * std::numeric_limits<float>::infinity());
|
||||
ASSERT_EQ(minus_inf.first, -1);
|
||||
ASSERT_EQ(minus_inf.second, 0);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user