2017-10-27 22:55:33 +02:00
|
|
|
from conans import ConanFile, CMake
|
|
|
|
import os
|
|
|
|
|
|
|
|
class SystemcTestConan(ConanFile):
|
|
|
|
settings = "os", "compiler", "build_type", "arch"
|
2018-02-22 21:35:06 +01:00
|
|
|
options = {"stdcxx":[98,11,14], "shared":[True,False]}
|
2020-04-05 15:36:06 +02:00
|
|
|
default_options = "stdcxx=11","shared=True"
|
2017-10-27 22:55:33 +02:00
|
|
|
generators = "cmake"
|
|
|
|
|
2018-02-22 21:35:06 +01:00
|
|
|
def configure(self):
|
|
|
|
self.options["SystemC"].stdcxx = self.options.stdcxx
|
|
|
|
self.options["SystemC"].shared = self.options.shared
|
|
|
|
|
2017-10-27 22:55:33 +02:00
|
|
|
def build(self):
|
|
|
|
cmake = CMake(self)
|
2018-02-22 21:35:06 +01:00
|
|
|
cmake.definitions["CMAKE_CXX_STANDARD"] = self.options["SystemC"].stdcxx
|
2020-04-05 15:36:06 +02:00
|
|
|
cmake.definitions["CMAKE_CXX_FLAGS"]="-D_GLIBCXX_USE_CXX11_ABI=%d" %(0 if self.settings.compiler.libcxx == 'libstdc++' else 1)
|
2018-02-22 21:35:06 +01:00
|
|
|
cmake.configure()
|
|
|
|
cmake.build()
|
2017-10-27 22:55:33 +02:00
|
|
|
|
|
|
|
def imports(self):
|
|
|
|
self.copy("*.dll", dst="bin", src="bin")
|
|
|
|
self.copy("*.dylib*", dst="bin", src="lib")
|
|
|
|
self.copy('*.so*', dst='bin', src='lib')
|
|
|
|
|
|
|
|
def test(self):
|
|
|
|
os.chdir("bin")
|
|
|
|
self.run(".%sexample" % os.sep)
|