2019-12-29 14:29:52 +00:00
|
|
|
from conans import ConanFile, CMake
|
2020-01-12 17:20:59 +00:00
|
|
|
from conans.errors import ConanInvalidConfiguration
|
2019-12-29 14:29:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PkmnLibConan(ConanFile):
|
|
|
|
name = "PkmnLib"
|
|
|
|
license = "TODO"
|
|
|
|
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
|
|
|
|
description = "The core implementation for turn based battling using creatures."
|
2020-01-01 18:59:47 +00:00
|
|
|
settings = "os", "compiler"
|
2020-01-12 17:20:59 +00:00
|
|
|
options = {"shared": [True, False], "script_handler": ["angelscript"]}
|
|
|
|
default_options = {"shared": True, "script_handler": "angelscript"}
|
2019-12-29 14:29:52 +00:00
|
|
|
generators = "cmake"
|
|
|
|
exports_sources = "*"
|
|
|
|
compiler = "clang"
|
|
|
|
|
|
|
|
def build(self):
|
|
|
|
cmake = CMake(self)
|
|
|
|
cmake.configure()
|
|
|
|
cmake.build()
|
|
|
|
|
|
|
|
def package(self):
|
|
|
|
self.copy("*.hpp", dst="include", src="src")
|
2020-01-09 18:03:38 +00:00
|
|
|
self.copy("*.h", dst="include", src="src")
|
2019-12-29 14:29:52 +00:00
|
|
|
self.copy("*.lib", dst="lib", keep_path=False)
|
|
|
|
self.copy("*.dll", dst="bin", keep_path=False)
|
|
|
|
self.copy("*.dylib*", dst="lib", keep_path=False)
|
|
|
|
self.copy("*.so", dst="lib", keep_path=False)
|
|
|
|
self.copy("*.a", dst="lib", keep_path=False)
|
2020-01-01 18:59:47 +00:00
|
|
|
|
|
|
|
def imports(self):
|
|
|
|
if self.settings.os == "Windows":
|
|
|
|
self.copy("*.dll", "bin", "bin")
|
2020-01-12 17:20:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
def configure(self):
|
|
|
|
if self.options.script_handler == "angelscript":
|
|
|
|
self.options["AngelScript"].shared = True
|
|
|
|
if self.settings.os == "Windows":
|
|
|
|
self.options["AngelScript"].link_std_statically = True
|
|
|
|
|
|
|
|
def requirements(self):
|
2020-02-01 15:56:09 +00:00
|
|
|
self.requires("CreatureLib/bb9b9609a6e595ff8e6d4f4682b4be5b5e8d9d7e@creaturelib/master")
|
2020-01-12 17:20:59 +00:00
|
|
|
if self.options.script_handler == "angelscript":
|
|
|
|
self.requires("AngelScript/2.34@AngelScript/Deukhoofd")
|
|
|
|
else:
|
|
|
|
raise ConanInvalidConfiguration("Invalid Script Handler was specified: " + self.options.script_handler)
|