-
Notifications
You must be signed in to change notification settings - Fork 13
/
conanfile.py
49 lines (41 loc) · 1.7 KB
/
conanfile.py
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
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020-2023 Intel Corporation
from conans import ConanFile, CMake, tools
from conans.tools import load
from conans.model.version import Version
import os
class MeteeConan(ConanFile):
name = "metee"
license = "SPDX-License-Identifier: Apache-2.0"
url = "https://github.com/intel/metee"
description = "Cross-platform access library for Intel(R) CSME HECI interface."
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = {"shared": False}
generators = "cmake", "visual_studio"
exports_sources = "*"
def configure(self):
del self.settings.compiler.libcxx
def package_id(self):
v = Version(str(self.settings.compiler.version))
if self.settings.compiler == "gcc" and (v >= "6" and v <= "12"):
self.info.settings.compiler.version = "GCC version between 6 and 12"
if self.settings.compiler == "clang" and (v >= "6" and v <= "15"):
self.info.settings.compiler.version = "clang version between 6 and 15"
def set_version(self):
content = load(os.path.join(self.recipe_folder, "VERSION"))
self.version = content
def _configure_cmake(self):
cmake = CMake(self)
if self.settings.os == "Windows" and "MT" in self.settings.compiler.runtime:
cmake.definitions["BUILD_MSVC_RUNTIME_STATIC"]="on"
cmake.configure(source_folder="")
return cmake
def build(self):
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_info(self):
self.cpp_info.libs = ["metee"]