fix non stdc++17 buildbots

This commit is contained in:
Balazs Benics 2019-07-28 14:43:07 +02:00
parent a362b570bb
commit 7276880fdf
3 changed files with 38 additions and 37 deletions

View file

@ -24,15 +24,6 @@ osx: &osx
matrix:
include:
# - <<: *linux
# env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49
# - <<: *linux
# env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5
# - <<: *linux
# env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6
- <<: *linux
env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7
@ -42,12 +33,6 @@ matrix:
- <<: *linux
env: CONAN_GCC_VERSIONS=9 CONAN_DOCKER_IMAGE=conanio/gcc9
# - <<: *linux
# env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39
- <<: *linux
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40
- <<: *linux
env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50
@ -60,14 +45,6 @@ matrix:
- <<: *linux
env: CONAN_CLANG_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/clang8
- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3
- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1
- <<: *osx
osx_image: xcode9.2
env: CONAN_APPLE_CLANG_VERSIONS=9.0

View file

@ -4,18 +4,18 @@ environment:
PYTHON: "C:\\Python37"
matrix:
- MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 5@x86_64@seh@posix, 6@x86_64@seh@posix, 7@x86_64@seh@posix'
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CONAN_VISUAL_VERSIONS: 14
- MINGW_CONFIGURATIONS: '7@x86_64@seh@posix, 7@x86@seh@posix, 8@x86_64@seh@posix, 8@x86@seh@posix'
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONAN_VISUAL_VERSIONS: 15
CONAN_BUILD_TYPES: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CONAN_VISUAL_VERSIONS: 14
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONAN_VISUAL_VERSIONS: 15
CONAN_BUILD_TYPES: Debug
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONAN_VISUAL_VERSIONS: 15
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CONAN_VISUAL_VERSIONS: 16
CONAN_BUILD_TYPES: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONAN_VISUAL_VERSIONS: 15
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CONAN_VISUAL_VERSIONS: 16
CONAN_BUILD_TYPES: Debug

View file

@ -1,9 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools, CMake
import os
from conans import ConanFile, CMake
from conans.model.version import Version
from conans.errors import ConanException
class NameofConan(ConanFile):
name = 'nameof'
@ -32,15 +32,39 @@ class NameofConan(ConanFile):
'build_examples': False,
}
@property
def supports_string_view(self):
compiler = str(self.settings.compiler)
version = Version(str(self.settings.compiler.version))
if compiler == 'Visual Studio' and version >= Version('15'):
return True
if compiler == 'gcc' and version >= Version('7'):
return True
if compiler == 'icc' and version >= Version('19'):
return True
if compiler == 'clang' and version >= Version('5'):
return True
if compiler == 'apple-clang' and version >= Version('9'):
return True
return False
def requirements(self):
if self.options.build_tests:
self.requires('Catch2/2.9.1@catchorg/stable')
def configure(self):
if not self.supports_string_view:
raise ConanException('The specified compiler must support C++17')
def config_options(self):
needs_build = self.options.build_tests or self.options.build_examples
if not needs_build:
# remove all build settings since it is a header-only library
self.options.remove(['os', 'compiler', 'build_type', 'arch'])
if not needs_build:
del self.options.os
del self.options.compiler
del self.options.build_type
del self.options.arch
def configure_cmake(self):
cmake = CMake(self)