conan-recipes/SystemC/conanfile.py

46 lines
1.8 KiB
Python
Raw Normal View History

2017-10-27 22:55:33 +02:00
from conans import ConanFile, CMake
class SystemCConan(ConanFile):
2017-10-27 22:55:33 +02:00
name = "SystemC"
2019-06-15 22:31:04 +02:00
version = "2.3.3"
2017-10-27 22:55:33 +02:00
license = "Apache 2.0 License"
2017-10-28 18:07:51 +02:00
url = "https://github.com/Minres/conan-recipes/blob/master/SystemC"
2017-10-27 22:55:33 +02:00
description = "SystemC is a set of C++ classes and macros which provide an event-driven simulation interface (see also discrete event simulation)."
settings = "os", "compiler", "build_type", "arch"
2020-04-05 15:36:06 +02:00
options = {"shared":[True, False], "stdcxx":[98,11,14], "phase_cb":[True, False]}
default_options = "shared=True","stdcxx=11","phase_cb=False"
2017-10-27 22:55:33 +02:00
generators = "cmake"
2019-06-15 22:31:04 +02:00
source_subfolder = "systemc-2.3.3"
exports_sources = "systemc-2.3.3/*"
2017-10-27 22:55:33 +02:00
def build(self):
2017-10-28 17:07:33 +02:00
cmake = CMake(self, parallel=True)
cmake.configure(
source_folder=self.source_subfolder,
args=[
2020-04-05 15:36:06 +02:00
'-DCMAKE_CXX_FLAGS:="-D_GLIBCXX_USE_CXX11_ABI=%d"' % (0 if self.settings.compiler.libcxx == 'libstdc++' else 1),
'-DBUILD_SHARED_LIBS=%s' % ('ON' if self.options.shared else 'OFF'),
'-DCMAKE_INSTALL_LIBDIR=lib',
'-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx,
'-DENABLE_PHASE_CALLBACKS=%s' % ('ON' if self.options.phase_cb else 'OFF'),
'-DENABLE_PHASE_CALLBACKS_TRACING=%s' % ('ON' if self.options.phase_cb else 'OFF')
]
)
cmake.build()
cmake.install()
2019-06-15 22:31:04 +02:00
def package(self):
pass
# Headers
#self.copy(pattern="*.h", dst="include", src="package/include", keep_path=True)
# Libs
#self.copy(pattern="*", dst="lib", src="package/lib", keep_path=False)
2017-10-27 22:55:33 +02:00
def package_info(self):
2020-04-05 15:36:06 +02:00
self.cpp_info.libs = ["systemc"]
if self.settings.os == "Linux":
self.cpp_info.libs.append("pthread")
2017-10-27 22:55:33 +02:00