Browse Source

libsdl_gfx: Fix compilation with only VS 2022 (#1260)

Jérôme Leclercq 3 năm trước cách đây
mục cha
commit
d41c1a83af
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      packages/l/libsdl_gfx/xmake.lua

+ 6 - 2
packages/l/libsdl_gfx/xmake.lua

@@ -32,8 +32,9 @@ package("libsdl_gfx")
     add_includedirs("include", "include/SDL2")
 
     on_install("windows", function(package)
-        local vs = import("core.tool.toolchain").load("msvc"):config("vs")
-        if tonumber(vs) < 2019 then
+        import("core.tool.toolchain")
+        local vs = tonumber(toolchain.load("msvc"):config("vs"))
+        if vs < 2019 then
             raise("Your compiler is too old to use this library.")
         end
 
@@ -52,6 +53,9 @@ package("libsdl_gfx")
 
         table.insert(configs, "/property:Configuration=" .. mode)
         table.insert(configs, "/property:Platform=" .. arch)
+        if vs >= 2022 then
+            table.insert(configs, "/p:PlatformToolset=v143")
+        end
         table.insert(configs, "-target:SDL2_gfx")
 
         import("package.tools.msbuild").build(package, configs)