From e89991561515b3e34a0b8401c55fba147b1c1c42 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 22 Feb 2018 20:36:58 +0000 Subject: [PATCH] Added recipe for SystemC CCI package --- SystemC-CCI/build.py | 11 +++++++++ SystemC-CCI/conanfile.py | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 SystemC-CCI/build.py create mode 100644 SystemC-CCI/conanfile.py diff --git a/SystemC-CCI/build.py b/SystemC-CCI/build.py new file mode 100644 index 0000000..94dd6a8 --- /dev/null +++ b/SystemC-CCI/build.py @@ -0,0 +1,11 @@ +from conan.packager import ConanMultiPackager + +if __name__ == "__main__": + builder = ConanMultiPackager() + archs = ['x86', 'x86_64'] + types = ['Debug','Release'] + cxxstds = ['98','11','14'] + configs = [[i,k] for i in cxxstds for k in types] + for triple in configs: + builder.add(settings={"build_type":triple[1]}, options={"stdcxx" : triple[0]}, env_vars={}, build_requires={}) + builder.run() diff --git a/SystemC-CCI/conanfile.py b/SystemC-CCI/conanfile.py new file mode 100644 index 0000000..7fee287 --- /dev/null +++ b/SystemC-CCI/conanfile.py @@ -0,0 +1,50 @@ +from conans import ConanFile, tools, AutoToolsBuildEnvironment +import os + +class SystemC_CCIConan(ConanFile): + name = "SystemC-CCI" + version = "0.9.0" + license = "Apache 2.0 License" + url = "https://github.com/Minres/conan-recipes/blob/master/SystemC-CCI" + description = "The SystemC Configuration, Control and Inspection (CCI) allows tools to seamlessly and consistently interact with models to provide essential capabilities." + settings = "os", "compiler", "build_type", "arch" + options = {"stdcxx":[98,11,14]} + default_options = "stdcxx=98" + generators = "gcc" + source_subfolder = "cci-0.9.0_pub_rev_20171219" + exports_sources = "cci-0.9.0_pub_rev_20171219/*" + requires = "SystemC/2.3.2@minres/stable" + + def configure(self): + self.options["SystemC"].stdcxx = self.options.stdcxx + + def build(self): + env_build = AutoToolsBuildEnvironment(self) + if self.options.stdcxx == "14": + env_build.cxx_flags = "-std=gnu++14" + elif self.options.stdcxx == "11": + env_build.cxx_flags = "-std=gnu++11" + elif self.options.stdcxx == "98": + env_build.cxx_flags = "-std=gnu++98" + env_build.fpic = True + with tools.chdir(os.path.join(self.source_subfolder, 'src')): + env_build.make(args=[ + 'SYSTEMC_HOME=%s' % self.deps_cpp_info["SystemC"].rootpath + ]) + + def package(self): + # Headers + inc_dir = os.path.join(self.source_subfolder, 'src') + self.copy(pattern="cci_configuration", dst="include", src=inc_dir, keep_path=True) + self.copy(pattern="*.h", dst="include", src=inc_dir, keep_path=True) + # Libs + lib_dir = os.path.join(self.source_subfolder, 'lib') + self.copy(pattern="*", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*", dst="lib", src=lib_dir, keep_path=False) + self.copy(pattern="*", dst="lib", src=lib_dir, keep_path=False) + + def package_info(self): + self.cpp_info.libs = ["cciapi"]