Kaynağa Gözat

cpptrace: fix libdwarf & zstd (#5868)

* cpptrace: fix libdwarf & zstd

* libdwarf: fix patch file
star9029 8 ay önce
ebeveyn
işleme
7d4031c5a8
2 değiştirilmiş dosya ile 10 ekleme ve 15 silme
  1. 8 15
      packages/c/cpptrace/xmake.lua
  2. 2 0
      packages/l/libdwarf/xmake.lua

+ 8 - 15
packages/c/cpptrace/xmake.lua

@@ -22,40 +22,33 @@ package("cpptrace")
 
     add_patches("0.5.2", "https://github.com/jeremy-rifkin/cpptrace/commit/599d6abd6cc74e80e8429fc309247be5f7edd5d7.patch", "977e6c17400ff2f85362ca1d6959038fdb5d9e5b402cfdd705b422c566e8e87a")
 
-    if is_plat("windows") then
+    if is_plat("windows", "mingw") then
         add_syslinks("dbghelp")
-    elseif is_plat("macosx") then
-        add_deps("libdwarf")
-    elseif is_plat("linux") or is_plat("cross") then
-        add_deps("libdwarf")
+    elseif is_plat("linux", "cross") then
         add_syslinks("dl")
-    elseif is_plat("mingw") then
-        add_deps("libdwarf")
-        add_syslinks("dbghelp")
     end
 
     add_deps("cmake")
+    if not is_plat("windows") then
+        add_deps("libdwarf")
+    end
 
     on_install("linux", "macosx", "windows", "mingw", "cross", function (package)
-        io.replace("CMakeLists.txt", "/WX", "", {plain = true})
-
         if not package:config("shared") then
             package:add("defines", "CPPTRACE_STATIC_DEFINE")
         end
 
+        io.replace("CMakeLists.txt", "/WX", "", {plain = true})
+
         local configs = {
             "-DBUILD_TESTING=OFF",
             "-DCPPTRACE_USE_EXTERNAL_LIBDWARF=ON",
             "-DCPPTRACE_USE_EXTERNAL_ZSTD=ON",
+            "-DCPPTRACE_VCPKG=ON",
         }
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs)
-
-        if package:is_plat("windows") and package:is_debug() then
-            local dir = package:installdir(package:config("shared") and "bin" or "lib")
-            os.trycp(path.join(package:buildir(), "cpptrace.pdb"), dir)
-        end
     end)
 
     on_test(function (package)

+ 2 - 0
packages/l/libdwarf/xmake.lua

@@ -31,8 +31,10 @@ package("libdwarf")
         if package:gitref() or version:ge("0.9.2") then
             -- https://github.com/davea42/libdwarf-code/pull/226
             io.replace("CMakeLists.txt", "find_package(zstd)", "find_package(zstd CONFIG REQUIRED)", {plain = true})
+            io.replace("src/lib/libdwarf/CMakeLists.txt", [[install(FILES "${PROJECT_SOURCE_DIR}/cmake/Findzstd.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf")]], "", {plain = true})
         else
             io.replace("CMakeLists.txt", "find_package(ZSTD)", "find_package(zstd CONFIG REQUIRED)", {plain = true})
+            io.replace("src/lib/libdwarf/CMakeLists.txt", [[install(FILES "${PROJECT_SOURCE_DIR}/cmake/FindZSTD.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libdwarf")]], "", {plain = true})
         end
         io.replace("CMakeLists.txt", [[set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")]], "", {plain = true})
         if not package:config("tools") then