2017-10-28 17:07:33 +02:00
|
|
|
from conans import ConanFile, tools, AutoToolsBuildEnvironment
|
2018-02-22 21:35:06 +01:00
|
|
|
import os
|
2017-10-28 17:07:33 +02:00
|
|
|
|
|
|
|
class SystemcverificationConan(ConanFile):
|
2022-10-20 21:33:32 +02:00
|
|
|
name = "systemc-scv"
|
2018-02-22 21:35:06 +01:00
|
|
|
version = "2.0.1"
|
2017-10-28 18:07:51 +02:00
|
|
|
license = "Apache 2.0 License"
|
|
|
|
url = "https://github.com/Minres/conan-recipes/blob/master/SystemCVerification"
|
|
|
|
description = "The SystemC Verification (SCV) library provides a common set of APIs that are used as a basis to verification activities with SystemC"
|
2022-10-20 21:33:32 +02:00
|
|
|
settings = "os", "compiler", "build_type", "arch", "cppstd"
|
|
|
|
options = {"shared": [True, False]}
|
|
|
|
default_options = "shared=False"
|
2018-02-22 21:35:06 +01:00
|
|
|
generators = "gcc"
|
|
|
|
source_subfolder = "scv-2.0.1"
|
|
|
|
exports_sources = "scv-2.0.1/*"
|
2022-10-20 21:33:32 +02:00
|
|
|
requires = "systemc/2.3.3"
|
2017-10-28 17:07:33 +02:00
|
|
|
|
|
|
|
def build(self):
|
|
|
|
env_build = AutoToolsBuildEnvironment(self)
|
2022-10-20 21:33:32 +02:00
|
|
|
if self.settings.cppstd == "14":
|
2019-06-15 22:31:04 +02:00
|
|
|
if self.settings.compiler.libcxx == 'libstdc++11':
|
|
|
|
env_build.cxx_flags = "-std=gnu++14 -D_GLIBCXX_USE_CXX11_ABI=1"
|
|
|
|
else:
|
|
|
|
env_build.cxx_flags = "-std=gnu++14 -D_GLIBCXX_USE_CXX11_ABI=0"
|
2022-10-20 21:33:32 +02:00
|
|
|
elif self.settings.cppstd == "11":
|
2019-06-15 22:31:04 +02:00
|
|
|
if self.settings.compiler.libcxx == 'libstdc++11':
|
|
|
|
env_build.cxx_flags = "-std=gnu++11 -D_GLIBCXX_USE_CXX11_ABI=1"
|
|
|
|
else:
|
|
|
|
env_build.cxx_flags = "-std=gnu++11 -D_GLIBCXX_USE_CXX11_ABI=0"
|
2022-10-20 21:33:32 +02:00
|
|
|
elif self.settings.cppstd == "98":
|
2018-02-22 21:35:06 +01:00
|
|
|
env_build.cxx_flags = "-std=gnu++98"
|
|
|
|
env_build.fpic = True
|
|
|
|
tools.mkdir("build")
|
2019-06-15 22:31:04 +02:00
|
|
|
# make sure timestamps are correct to avoid invocation of autoconf tools
|
|
|
|
tools.touch("%s/aclocal.m4" % os.path.join(self.source_folder, self.source_subfolder))
|
|
|
|
tools.touch("%s/Makefile.in" % os.path.join(self.source_folder, self.source_subfolder))
|
|
|
|
tools.touch("%s/configure" % os.path.join(self.source_folder, self.source_subfolder))
|
2018-10-30 17:29:48 +01:00
|
|
|
env_build.libs.remove('systemc')
|
2018-02-22 21:35:06 +01:00
|
|
|
with tools.chdir("build"):
|
|
|
|
env_build.configure(
|
|
|
|
configure_dir=os.path.join(self.source_folder, self.source_subfolder),
|
|
|
|
args=[
|
|
|
|
'--prefix=%s' % os.path.join(self.source_folder, 'install'),
|
2022-10-20 21:33:32 +02:00
|
|
|
'--with-systemc=%s' % self.deps_cpp_info["systemc"].rootpath,
|
|
|
|
'--enable-static=no' if self.options.shared else '--enable-static=yes',
|
|
|
|
'--enable-shared=yes' if self.options.shared else '--enable-shared=no',
|
|
|
|
'--disable-debug' if self.settings.build_type == "Release" else '--disable-opt'
|
2018-02-22 21:35:06 +01:00
|
|
|
]
|
|
|
|
)
|
|
|
|
env_build.make()
|
|
|
|
env_build.make(args=["install"])
|
|
|
|
#env_build.make(args=["check"])
|
2017-10-28 17:07:33 +02:00
|
|
|
|
|
|
|
def package(self):
|
|
|
|
# Headers
|
2018-02-22 21:35:06 +01:00
|
|
|
self.copy(pattern="*.h", dst="include", src="install/include", keep_path=True)
|
2017-10-28 17:07:33 +02:00
|
|
|
# Libs
|
2018-02-22 21:35:06 +01:00
|
|
|
self.copy(pattern="*", dst="lib", src="install/lib-linux", keep_path=False)
|
|
|
|
self.copy(pattern="*", dst="lib", src="install/lib-linux64", keep_path=False)
|
|
|
|
self.copy(pattern="*", dst="lib", src="install/lib-macosx", keep_path=False)
|
|
|
|
self.copy(pattern="*", dst="lib", src="install/lib-macosx64", keep_path=False)
|
|
|
|
self.copy(pattern="*", dst="lib", src="install/lib-cygwin", keep_path=False)
|
|
|
|
self.copy(pattern="*", dst="lib", src="install/lib-mingw", keep_path=False)
|
2017-10-28 17:07:33 +02:00
|
|
|
|
|
|
|
def package_info(self):
|
|
|
|
self.cpp_info.libs = ["scv"]
|