2019-07-27 16:53:03 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2019-08-24 15:31:42 +00:00
|
|
|
from conans import ConanFile
|
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-10-02 13:37:50 +00:00
|
|
|
version = "0.9.1"
|
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)
|
|
|
|
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).")
|
|
|
|
|
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")
|
2019-07-28 20:04:16 +00:00
|
|
|
|
|
|
|
def package_id(self):
|
|
|
|
self.info.header_only()
|