-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
executable file
·61 lines (54 loc) · 2.15 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
50
51
52
53
54
55
56
57
58
59
60
61
from conans import ConanFile, CMake, tools
from conans.util import files
import yaml
class Qmg2ScConan(ConanFile):
name = "qmg2sc"
version = str(yaml.load(tools.load("settings.yml"))['project']['version'])
license = "MIT"
url = "https://git.hiventive.com/framework/qmg2sc.git"
description = "QEMU-Machine-Generator to SystemC bridge"
settings = "cppstd", "os", "compiler", "build_type", "arch"
options = {"shared": [True, False],
"fPIC": [True, False],
"fPIE": [True, False],
"target_aarch64": [True, False],
"target_arm": [True, False]}
default_options = {opt: False for opt in options}
generators = "cmake"
exports = "settings.yml"
exports_sources = "src/*", "CMakeLists.txt"
requires = "gtest/1.8.0@bincrafters/stable", \
"systemc/[~=2.3.2]@hiventive/stable", \
"module/[~=0.2.0]@hiventive/testing", \
"communication/[~=0.1.0]@hiventive/testing", \
"qmg/[~=0.6.3]@hiventive/testing"
def configure(self):
if self.options.target_aarch64:
self.options["qmg"].target_aarch64 = True
if self.options.target_arm:
self.options["qmg"].target_arm = True
def _configure_cmake(self):
cmake = CMake(self)
target_list = []
if self.options.target_aarch64:
target_list.append("aarch64")
if self.options.target_arm:
target_list.append("arm")
if self.settings.os != "Windows":
cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.fPIC or self.options.fPIE
cmake.definitions["QMG2SC_TARGET_LIST"] = ";".join(target_list)
return cmake
def build(self):
cmake = self._configure_cmake()
cmake.configure()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_info(self):
libs_list = []
if self.options.target_aarch64:
libs_list.append("qmg2sc-aarch64")
if self.options.target_arm:
libs_list.append("qmg2sc-arm")
self.cpp_info.libs = libs_list