nameof_module/conanfile.py

53 lines
1.6 KiB
Python
Raw Normal View History

2019-07-27 16:53:03 +00:00
# -*- coding: utf-8 -*-
2020-01-31 09:04:09 +00:00
from conans import ConanFile, tools
2019-08-27 12:08:45 +00:00
from conans.errors import ConanInvalidConfiguration
2019-07-27 16:53:03 +00:00
class NameofConan(ConanFile):
2019-08-27 12:08:45 +00:00
name = "nameof"
2019-12-30 14:34:00 +00:00
version = "0.9.3"
2019-08-27 12:08:45 +00:00
description = "Header-only C++17 library provides nameof macros and functions to simply obtain the name of a variable, type, function, macro, and enum."
2019-07-27 16:53:03 +00:00
topics = (
2019-08-27 12:08:45 +00:00
"conan",
"nameof",
"cplusplus",
"enum-to-string",
"serialization",
"reflection",
"header-only",
"compile-time"
2019-07-27 16:53:03 +00:00
)
2019-08-27 12:08:45 +00:00
url = "https://github.com/Neargye/nameof"
homepage = "https://github.com/Neargye/nameof"
author = "Daniil Goncharov <neargye@gmail.com>"
license = "MIT"
2019-08-24 15:31:42 +00:00
exports_sources = ["include/*", "LICENCE"]
exports = ["LICENSE"]
2019-08-29 18:24:11 +00:00
settings = "compiler"
2019-08-24 15:31:42 +00:00
no_copy_source = True
2019-07-27 16:53:03 +00:00
2019-08-27 12:08:45 +00:00
@property
def supported_compiler(self):
compiler = str(self.settings.compiler)
2020-01-31 09:04:09 +00:00
version = tools.Version(self.settings.compiler.version)
2019-08-27 12:08:45 +00:00
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).")
2019-07-27 16:53:03 +00:00
def package(self):
2019-08-24 15:31:42 +00:00
self.copy("include/*")
self.copy("LICENSE", dst="licenses")
def package_id(self):
self.info.header_only()