Pārlūkot izejas kodu

Adjust ls-std 2022.1.0 recipe

The recipe for ls-std 2022.1.0 is now also supporting building shared libraries.
Patrick-Christopher Mattulat 2 gadi atpakaļ
vecāks
revīzija
4383337368
1 mainītis faili ar 14 papildinājumiem un 2 dzēšanām
  1. 14 2
      recipes/ls-std/2022_1_0/conanfile.py

+ 14 - 2
recipes/ls-std/2022_1_0/conanfile.py

@@ -20,14 +20,26 @@ class LsStdConan(ConanFile):
                  " --single-branch")
 
     def build(self):
-        cmake = CMake(self)
-        cmake.configure(source_folder="ls-standard-library")
+        cmake = self.__configure_cmake()
         cmake.build()
 
     def package(self):
         self.copy("*.hpp", dst="include", src="ls-standard-library/include")
         self.copy("*.lib", dst="lib", keep_path=False)
         self.copy("*.a", dst="lib", keep_path=False)
+        self.copy("*.so", dst="lib", keep_path=False)
+        self.copy("*.dll", dst="lib", keep_path=False)
 
     def package_info(self):
         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"]
+
+    def __configure_cmake(self):
+        cmake = CMake(self)
+
+        if self.options.shared:
+            cmake.definitions['LS_STD_BUILD_STATIC'] = "OFF"
+            cmake.definitions['LS_STD_BUILD_SHARED'] = "ON"
+
+        cmake.configure(source_folder="ls-standard-library")
+
+        return cmake