conanfile.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from conans import ConanFile, CMake
  2. class LsStdConan(ConanFile):
  3. name = "ls-std"
  4. version = "2023.2.0"
  5. license = "MIT"
  6. url = "<Package recipe repository url here, for issues about the package>"
  7. description = "This is a cross-platform standard library written in C++ offering functionalities you would usually miss in C++'s standard template library (STL), especially if you would search for cross-platform implementations."
  8. topics = ("boxing", "core", "encoding", "event", "io", "logic", "time")
  9. settings = "os", "compiler", "build_type", "arch"
  10. options = {"shared": [True, False]}
  11. default_options = {"shared": False}
  12. generators = "cmake"
  13. def source(self):
  14. self.run("git clone https://vcs.lynarstudios.de/public/ls-standard-library.git --branch v" + self.version +
  15. " --single-branch")
  16. def build(self):
  17. cmake = self.__configure_cmake()
  18. cmake.build()
  19. def package(self):
  20. self.copy("*.hpp", dst="include", src="ls-standard-library/include")
  21. self.copy("*.lib", dst="lib", keep_path=False)
  22. self.copy("*.a", dst="lib", keep_path=False)
  23. self.copy("*.so", dst="lib", keep_path=False)
  24. self.copy("*.dll", dst="lib", keep_path=False)
  25. self.copy("*.dylib", dst="lib", keep_path=False)
  26. def package_info(self):
  27. self.cpp_info.libs = ["ls-std-boxing", "ls-std-core", "ls-std-encoding", "ls-std-event", "ls-std-io", "ls-std-logic", "ls-std-time"]
  28. def __configure_cmake(self):
  29. cmake = CMake(self)
  30. if self.options.shared:
  31. cmake.definitions['LS_STD_BUILD_STATIC'] = "OFF"
  32. cmake.definitions['LS_STD_BUILD_SHARED'] = "ON"
  33. cmake.configure(source_folder="ls-standard-library")
  34. return cmake