Blame view

3rdparty/boost_1_81_0/libs/leaf/conanfile.py 2.7 KB
66d54af3   Hu Chunming   提交_GLIBCXX_USE_CX...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  from conan import ConanFile
  from conan.tools.files import get, copy
  from conan.tools.layout import basic_layout
  from conan.tools.build import check_min_cppstd
  from conan.errors import ConanInvalidConfiguration
  import os
  
  
  required_conan_version = ">=1.50.0"
  
  
  class BoostLEAFConan(ConanFile):
      name = "boost-leaf"
      version = "1.81.0-prerelease"
      license = "BSL-1.0"
      url = "https://github.com/conan-io/conan-center-index"
      homepage = "https://github.com/boostorg/leaf"
      description = ("Lightweight Error Augmentation Framework")
      topics = ("multi-platform", "multi-threading", "cpp11", "error-handling",
                "header-only", "low-latency", "no-dependencies", "single-header")
      settings = "os", "compiler", "arch", "build_type"
      exports_sources = "include/*", "LICENSE_1_0.txt"
      no_copy_source = True
  
      def package_id(self):
          self.info.clear()
  
      @property
      def _min_cppstd(self):
          return "11"
  
      @property
      def _compilers_minimum_version(self):
          return {
              "gcc": "4.8",
              "Visual Studio": "17",
              "msvc": "141",
              "clang": "3.9",
              "apple-clang": "10.0.0"
          }
  
      def requirements(self):
          pass
  
      def validate(self):
          if self.settings.get_safe("compiler.cppstd"):
              check_min_cppstd(self, self._min_cppstd)
  
          def lazy_lt_semver(v1, v2):
              lv1 = [int(v) for v in v1.split(".")]
              lv2 = [int(v) for v in v2.split(".")]
              min_length = min(len(lv1), len(lv2))
              return lv1[:min_length] < lv2[:min_length]
  
          compiler = str(self.settings.compiler)
          version = str(self.settings.compiler.version)
          minimum_version = self._compilers_minimum_version.get(compiler, False)
  
          if minimum_version and lazy_lt_semver(version, minimum_version):
              raise ConanInvalidConfiguration(
                  f"{self.name} {self.version} requires C++{self._min_cppstd}, which your compiler ({compiler}-{version}) does not support")
  
      def layout(self):
          basic_layout(self)
  
      def package(self):
          copy(self, "LICENSE", dst=os.path.join(
              self.package_folder, "licenses"),  src=self.source_folder)
          copy(self, "*.h", dst=os.path.join(self.package_folder, "include"),
               src=os.path.join(self.source_folder, "include"))
          copy(self, "*.hpp", dst=os.path.join(self.package_folder,
               "include"), src=os.path.join(self.source_folder, "include"))
  
      def package_info(self):
          self.cpp_info.set_property("cmake_target_name", "boost::leaf")
  
          self.cpp_info.bindirs = []
          self.cpp_info.frameworkdirs = []
          self.cpp_info.libdirs = []
          self.cpp_info.resdirs = []