From da3e9cab3f7024e85a87ad4459ec4760e0274d68 Mon Sep 17 00:00:00 2001 From: eyck Date: Fri, 11 Dec 2020 18:49:04 +0000 Subject: [PATCH] add SystemC-Components package --- SystemC-Components/build.py | 18 ++++++++++++ SystemC-Components/conanfile.py | 51 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100755 SystemC-Components/build.py create mode 100644 SystemC-Components/conanfile.py diff --git a/SystemC-Components/build.py b/SystemC-Components/build.py new file mode 100755 index 0000000..e903c0b --- /dev/null +++ b/SystemC-Components/build.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +from conan.packager import ConanMultiPackager + + +if __name__ == "__main__": + builder = ConanMultiPackager(username="minres") + types = ['Debug','Release'] + cxxstds = ['11','14'] + libstdcxx = ['libstdc++', 'libstdc++11'] + shared = [True, False] + for triple in [[i,k,l,s] for i in cxxstds for k in types for l in libstdcxx for s in shared]: + if triple[0] != '98' or triple[2] != 'libstdc++11': + builder.add( + settings={"build_type":triple[1],"compiler.libcxx":triple[2]}, + options={"stdcxx" : triple[0], "shared" : triple[3]}, + env_vars={}, + build_requires={}) + builder.run() diff --git a/SystemC-Components/conanfile.py b/SystemC-Components/conanfile.py new file mode 100644 index 0000000..d6b2a60 --- /dev/null +++ b/SystemC-Components/conanfile.py @@ -0,0 +1,51 @@ +from conans import ConanFile, CMake, tools +import os + +class SystemCComponentsConan(ConanFile): + name = "scc" + version = "1.0.0" + license = "Apache 2.0 License" + url = "https://github.com/Minres/SystemC-Components" + description = "light weight productivity library for SystemC and TLM 2.0" + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "stdcxx":[11,14,17], "fPIC":[True, False]} + default_options = "shared=True", "stdcxx=11", "fPIC=True" + generators = ["cmake", "cmake_find_package"] + + requires = ( + "boost/1.70.0@conan/stable", + "SystemC/2.3.3@minres/stable", + "SystemCVerification/2.0.1@minres/stable", + "SystemC-CCI/1.0.0@minres/stable" + ) + + def source(self): + self.run("git clone --recursive --branch %s https://github.com/Minres/SystemC-Components.git src" % self.version) + + def configure(self): + self.options["SystemC"].stdcxx = self.options.stdcxx + self.options["SystemCVerification"].stdcxx = self.options.stdcxx + self.options["SystemC-CCI"].stdcxx = self.options.stdcxx + + def build(self): + cmake = CMake(self, parallel=True) + cmake.configure( + source_folder='src', + args=[ + '-DCMAKE_CXX_FLAGS:="-D_GLIBCXX_USE_CXX11_ABI=%d"' % (0 if self.settings.compiler.libcxx == 'libstdc++' else 1), + '-DBUILD_SHARED_LIBS=ON' if self.options.shared else '-DBUILD_SHARED_LIBS=OFF', + '-DCMAKE_POSITION_INDEPENDENT_CODE=%s' % ('ON' if self.options.fPIC else 'OFF'), + '-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx, + '-DSYSTEMC_PREFIX=%s' % self.deps_cpp_info["SystemC"].rootpath, + '-DSCV_PREFIX=%s' % self.deps_cpp_info["SystemCVerification"].rootpath, + '-DCCI_PREFIX=%s' % self.deps_cpp_info["SystemC-CCI"].rootpath, + ] + ) + cmake.build() + cmake.install() + + def package_info(self): + pass + + def package_info(self): + self.cpp_info.libs = ["scc"]