Browse Source

Add mingw support to tmxparser (#1197)

* Add mingw support to tmxparser

* Add links on shared windows build

* Also change kind on windows

* Update xmake.lua

* Update xmake.lua

Co-authored-by: ruki <[email protected]>
PucklaMotzer09 3 năm trước cách đây
mục cha
commit
47094ed272
1 tập tin đã thay đổi với 6 bổ sung5 xóa
  1. 6 5
      packages/t/tmxparser/xmake.lua

+ 6 - 5
packages/t/tmxparser/xmake.lua

@@ -8,7 +8,7 @@ package("tmxparser")
 
 
     add_deps("zlib", "tinyxml2")
     add_deps("zlib", "tinyxml2")
 
 
-    on_install("windows", "macosx", "linux", function (package)
+    on_install("windows", "macosx", "linux", "mingw", function (package)
         io.gsub("include/Tmx.h.in", "@VERSION_PATCH@", "@VERSION_ALTER@")
         io.gsub("include/Tmx.h.in", "@VERSION_PATCH@", "@VERSION_ALTER@")
         io.writefile("xmake.lua", ([[
         io.writefile("xmake.lua", ([[
             set_version("%s")
             set_version("%s")
@@ -23,12 +23,13 @@ package("tmxparser")
                 set_configdir("include")
                 set_configdir("include")
                 add_configfiles("include/Tmx.h.in", {pattern = "@(.-)@"})
                 add_configfiles("include/Tmx.h.in", {pattern = "@(.-)@"})
                 add_files("src/**.cpp")
                 add_files("src/**.cpp")
+                if is_plat("windows") and is_kind("shared") then 
+                    add_rules("utils.symbols.export_all", {export_classes = true}) 
+                end 
         ]]):format(package:version_str()))
         ]]):format(package:version_str()))
         local configs = {}
         local configs = {}
-        if not package:is_plat("windows") then
-            configs.kind = (package:config("shared") and "shared" or "static")
-        end
-        if package:is_plat("linux") and package:config("pic") ~= false then
+        configs.kind = (package:config("shared") and "shared" or "static")
+        if package:is_plat("linux", "mingw") and package:config("pic") ~= false then
             configs.cxflags = "-fPIC"
             configs.cxflags = "-fPIC"
         end
         end
         import("package.tools.xmake").install(package, configs)
         import("package.tools.xmake").install(package, configs)