update conan.py
This commit is contained in:
parent
23c959c3e2
commit
d74130477e
1 changed files with 34 additions and 15 deletions
49
conanfile.py
49
conanfile.py
|
@ -1,29 +1,48 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from conans import ConanFile
|
from conans import ConanFile
|
||||||
|
from conans.errors import ConanInvalidConfiguration
|
||||||
|
|
||||||
class NameofConan(ConanFile):
|
class NameofConan(ConanFile):
|
||||||
name = 'nameof'
|
name = "nameof"
|
||||||
version = '0.9.0'
|
version = "0.9.0"
|
||||||
description = 'Header-only C++17 library provides nameof macros and functions to simply obtain the name of a variable, type, function, macro, and enum.'
|
description = "Header-only C++17 library provides nameof macros and functions to simply obtain the name of a variable, type, function, macro, and enum."
|
||||||
topics = (
|
topics = (
|
||||||
'conan',
|
"conan",
|
||||||
'nameof',
|
"nameof",
|
||||||
'cplusplus',
|
"cplusplus",
|
||||||
'enum-to-string',
|
"enum-to-string",
|
||||||
'serialization',
|
"serialization",
|
||||||
'reflection',
|
"reflection",
|
||||||
'header-only',
|
"header-only",
|
||||||
'compile-time'
|
"compile-time"
|
||||||
)
|
)
|
||||||
url = 'https://github.com/Neargye/nameof'
|
url = "https://github.com/Neargye/nameof"
|
||||||
homepage = 'https://github.com/Neargye/nameof'
|
homepage = "https://github.com/Neargye/nameof"
|
||||||
author = 'Daniil Goncharov <neargye@gmail.com>'
|
author = "Daniil Goncharov <neargye@gmail.com>"
|
||||||
license = 'MIT'
|
license = "MIT"
|
||||||
exports_sources = ["include/*", "LICENCE"]
|
exports_sources = ["include/*", "LICENCE"]
|
||||||
exports = ["LICENSE"]
|
exports = ["LICENSE"]
|
||||||
no_copy_source = True
|
no_copy_source = True
|
||||||
|
|
||||||
|
@property
|
||||||
|
def supported_compiler(self):
|
||||||
|
compiler = str(self.settings.compiler)
|
||||||
|
version = str(self.settings.compiler.version)
|
||||||
|
if compiler == "Visual Studio" and version >= "15":
|
||||||
|
return True
|
||||||
|
if compiler == "gcc" and version >= "7":
|
||||||
|
return True
|
||||||
|
if compiler == "clang" and version >= "5":
|
||||||
|
return True
|
||||||
|
if compiler == "apple-clang" and version >= "9":
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
if not self.supported_compiler:
|
||||||
|
raise ConanInvalidConfiguration("nameof: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility).")
|
||||||
|
|
||||||
def package(self):
|
def package(self):
|
||||||
self.copy("include/*")
|
self.copy("include/*")
|
||||||
self.copy("LICENSE", dst="licenses")
|
self.copy("LICENSE", dst="licenses")
|
||||||
|
|
Loading…
Reference in a new issue