2
0
Эх сурвалжийг харах

cpp-ipc: improve cmake build option (#6566)

star9029 7 сар өмнө
parent
commit
500c05225a

+ 9 - 11
packages/c/cpp-ipc/xmake.lua

@@ -1,14 +1,13 @@
 package("cpp-ipc")
 package("cpp-ipc")
-
     set_homepage("https://github.com/mutouyun/cpp-ipc")
     set_homepage("https://github.com/mutouyun/cpp-ipc")
     set_description("A high-performance inter-process communication using shared memory on Linux/Windows")
     set_description("A high-performance inter-process communication using shared memory on Linux/Windows")
     set_license("MIT")
     set_license("MIT")
 
 
-    set_urls("https://github.com/mutouyun/cpp-ipc/archive/refs/tags/v$(version).zip",
+    set_urls("https://github.com/mutouyun/cpp-ipc/archive/refs/tags/$(version).zip",
              "https://github.com/mutouyun/cpp-ipc.git")
              "https://github.com/mutouyun/cpp-ipc.git")
 
 
-    add_versions("1.3.0", "898f97a36c855a58dfe9645b73c388e6df7bcd3762a5c9a6a75b4bca60d72b4b")
-    add_versions("1.2.0", "31739760d8f191c7aaf71d1c453fce1989d1f74fdee9a61f9fdd475b29fe1888")
+    add_versions("v1.3.0", "898f97a36c855a58dfe9645b73c388e6df7bcd3762a5c9a6a75b4bca60d72b4b")
+    add_versions("v1.2.0", "31739760d8f191c7aaf71d1c453fce1989d1f74fdee9a61f9fdd475b29fe1888")
 
 
     add_deps("cmake")
     add_deps("cmake")
     if is_plat("windows") then
     if is_plat("windows") then
@@ -16,14 +15,13 @@ package("cpp-ipc")
     end
     end
 
 
     on_install("windows", "linux", "mingw", "cross", function (package)
     on_install("windows", "linux", "mingw", "cross", function (package)
-        local configs = {"-DLIBIPC_BUILD_TESTS=OFF", "-DLIBIPC_BUILD_DEMOS=OFF"}
-        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
-        table.insert(configs, "-DLIBIPC_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
-        if package:is_plat("windows") and package:config("vs_runtime"):startswith("MD") then
-            table.insert(configs, "-DLIBIPC_USE_STATIC_CRT=OFF")
-        else
-            table.insert(configs, "-DLIBIPC_USE_STATIC_CRT=ON")
+        if package:config("shared") then
+            package:add("defines", "LIBIPC_LIBRARY_SHARED_USING__")
         end
         end
+
+        local configs = {"-DLIBIPC_BUILD_TESTS=OFF", "-DLIBIPC_BUILD_DEMOS=OFF", "-DLIBIPC_USE_STATIC_CRT=OFF"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
+        table.insert(configs, "-DLIBIPC_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs)
         import("package.tools.cmake").install(package, configs)
     end)
     end)