mirror of
https://github.com/Minres/conan-recipes.git
synced 2025-07-01 15:33:27 +02:00
Updated conanfiles to work with release 1.0 of conan.io.
This commit is contained in:
@ -2,13 +2,11 @@ from conan.packager import ConanMultiPackager
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = ConanMultiPackager()
|
||||
cxxstds = ['98','11','14']
|
||||
archs = ['x86', 'x86_64']
|
||||
types = ['Debug','Release']
|
||||
#configs = [[i,j,k] for i in cxxstds for j in archs for k in types]
|
||||
#for triple in configs:
|
||||
# builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={})
|
||||
configs = [[i,k] for i in cxxstds for k in types]
|
||||
cxxstds = ['98', '11','14']
|
||||
shared = [True,False]
|
||||
configs = [[i,k,s] for i in cxxstds for k in types for s in shared]
|
||||
for triple in configs:
|
||||
builder.add(settings={"build_type":triple[1]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={})
|
||||
builder.add(settings={"build_type":triple[1]}, options={"stdcxx" : triple[0], "shared" : triple[2]}, env_vars={}, build_requires={})
|
||||
builder.run()
|
||||
|
@ -1,7 +1,7 @@
|
||||
from conans import ConanFile, CMake
|
||||
|
||||
|
||||
class SeasocksConan(ConanFile):
|
||||
class SystemCConan(ConanFile):
|
||||
name = "SystemC"
|
||||
version = "2.3.2"
|
||||
license = "Apache 2.0 License"
|
||||
@ -11,24 +11,28 @@ class SeasocksConan(ConanFile):
|
||||
options = {"shared": [True, False], "stdcxx":[98,11,14]}
|
||||
default_options = "shared=True","stdcxx=98"
|
||||
generators = "cmake"
|
||||
source_subfolder = "systemc-2.3.2"
|
||||
exports_sources = "systemc-2.3.2/*"
|
||||
|
||||
|
||||
# def build_id(self):
|
||||
# self.info_build.settings.build_type = "Any"
|
||||
|
||||
# def source(self):
|
||||
# self.run("git clone https://github.com/Minres/SystemCLanguage.git")
|
||||
# self.run("cd SystemCLanguage && git checkout master")
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self, parallel=True)
|
||||
cmake.configure(source_dir="%s/systemc-2.3.2" % self.source_folder)
|
||||
shared = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF"
|
||||
self.run('cmake systemc-2.3.2 %s %s -DCMAKE_CXX_STANDARD=%s' % (cmake.command_line, shared, self.options.stdcxx))
|
||||
# self.run("cmake --build . %s" % cmake.build_config)
|
||||
self.run("cmake --build . --target install %s" % cmake.build_config)
|
||||
cmake.configure(
|
||||
source_folder=self.source_subfolder,
|
||||
args=[
|
||||
"-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF",
|
||||
'-DCMAKE_CXX_STANDARD=%s' % self.options.stdcxx
|
||||
]
|
||||
)
|
||||
cmake.build()
|
||||
cmake.install()
|
||||
|
||||
def package(self):
|
||||
# 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)
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.libs = ["systemc"]
|
||||
self.cpp_info.libs = ["systemc", "pthread"]
|
||||
|
||||
|
@ -3,16 +3,19 @@ import os
|
||||
|
||||
class SystemcTestConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
options = {"stdcxx":[98,11,14], "shared":[True,False]}
|
||||
default_options = "stdcxx=98","shared=True"
|
||||
generators = "cmake"
|
||||
|
||||
def configure(self):
|
||||
self.options["SystemC"].stdcxx = self.options.stdcxx
|
||||
self.options["SystemC"].shared = self.options.shared
|
||||
|
||||
def build(self):
|
||||
cxxstd = self.options["SystemC"].stdcxx
|
||||
cmake = CMake(self)
|
||||
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package"
|
||||
cmake.configure(source_dir=self.conanfile_directory, build_dir="./")
|
||||
#cmake.build()
|
||||
self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd))
|
||||
self.run("cmake --build . %s" % cmake.build_config)
|
||||
cmake.definitions["CMAKE_CXX_STANDARD"] = self.options["SystemC"].stdcxx
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def imports(self):
|
||||
self.copy("*.dll", dst="bin", src="bin")
|
||||
|
Reference in New Issue
Block a user