[Volk, Backward-cpp, VulkanMemoryAllocator] Add mingw support (#1223)

* [Volk, Backward-cpp, VulkanMemoryAllocator] Add mingw support

* [Backward-cpp] Fix missing link to imagehlp on mingw platform

* [Backward-cpp] Fix patch hash

* [Backward-cpp] Fix __imp__set_abort_behavior link error

* [Backward-cpp] Fix compilation on mingw 32bits
pull/1226/head
Arthapz 3 years ago committed by GitHub
parent a688c9b6f2
commit 41c1977ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      packages/b/backward-cpp/patches/v1.6/fix_32bit_ssize_t_typedef.patch
  2. 11
      packages/b/backward-cpp/patches/v1.6/link_to_imagehlp.patch
  3. 10
      packages/b/backward-cpp/xmake.lua
  4. 3
      packages/v/volk/xmake.lua
  5. 2
      packages/v/vulkan-memory-allocator/xmake.lua

@ -0,0 +1,17 @@
diff -Naurw backward.hpp backward.hpp
--- backward.hpp
+++ backward.hpp
@@ -344,7 +344,12 @@
#include <thread>
#include <basetsd.h>
+
+#ifdef _WIN64
typedef SSIZE_T ssize_t;
+#else
+typedef int ssize_t;
+#endif
#ifndef NOMINMAX
#define NOMINMAX

@ -0,0 +1,11 @@
diff -Naurw CMakeLists.txt CMakeLists.txt
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -86,6 +86,7 @@
add_library(backward ${libtype} backward.cpp)
target_compile_definitions(backward PUBLIC ${BACKWARD_DEFINITIONS})
target_include_directories(backward PUBLIC ${BACKWARD_INCLUDE_DIRS})
+target_link_libraries(backward PUBLIC -limagehlp -lmsvcr110 -ldbghelp)
###############################################################################
# TESTS

@ -8,9 +8,17 @@ package("backward-cpp")
"https://github.com/bombela/backward-cpp.git")
add_versions("v1.6", "9b07e12656ab9af8779a84e06865233b9e30fadbb063bf94dd81d318081db8c2")
if is_plat("mingw") then
add_patches("v1.6", path.join(os.scriptdir(), "patches", "v1.6", "link_to_imagehlp.patch"), "0a135b6d68970ff6609a3eb4deb2b10c317eee15ba980eb178b93402a97c957c")
if is_arch("i386") then
add_patches("v1.6", path.join(os.scriptdir(), "patches", "v1.6", "fix_32bit_ssize_t_typedef.patch"), "fb372fe5934984aecb00b3153f737f63a542ff9359d159a9bcb79c5d54963b42")
end
end
add_deps("cmake")
on_install("linux", "macosx", "windows", function (package)
on_install("linux", "mingw", "macosx", "windows", function (package)
local configs = {"-DBACKWARD_TESTS=OFF"}
table.insert(configs, "-DBACKWARD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)

@ -19,7 +19,7 @@ package("volk")
add_syslinks("dl")
end
on_install("windows", "linux", "macosx", "iphoneos", "android", function (package)
on_install("windows", "linux", "macosx", "mingw", "iphoneos", "android", function (package)
if not package:config("header_only") then
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
@ -47,6 +47,7 @@ package("volk")
os.cp("volk.c", package:installdir("include"))
end
import("package.tools.xmake").install(package)
end)

@ -9,7 +9,7 @@ package("vulkan-memory-allocator")
add_deps("vulkan-headers")
on_install("windows", "linux", "macosx", "iphoneos", "android", function (package)
on_install("windows", "linux", "mingw", "macosx", "iphoneos", "android", function (package)
os.cp("include/vk_mem_alloc.h", package:installdir("include"))
end)

Loading…
Cancel
Save