conanfile.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from conans import ConanFile, CMake
  2. class LsStdConan(ConanFile):
  3. name = "ls-std"
  4. version = "rc-2023.2.2"
  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 -b rc-2023-2-2")
  15. def build(self):
  16. cmake = self.__configure_cmake()
  17. cmake.build()
  18. def package(self):
  19. self.copy("*.hpp", dst="include", src="ls-standard-library/include")
  20. self.copy("*.lib", dst="lib", keep_path=False)
  21. self.copy("*.a", dst="lib", keep_path=False)
  22. self.copy("*.so", dst="lib", keep_path=False)
  23. self.copy("*.dll", dst="lib", keep_path=False)
  24. self.copy("*.dylib", dst="lib", keep_path=False)
  25. def package_info(self):
  26. 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"]
  27. def __configure_cmake(self):
  28. cmake = CMake(self)
  29. if self.options.shared:
  30. cmake.definitions['LS_STD_BUILD_STATIC'] = "OFF"
  31. cmake.definitions['LS_STD_BUILD_SHARED'] = "ON"
  32. cmake.configure(source_folder="ls-standard-library")
  33. return cmake