瀏覽代碼

Fix code based on review in libsdl_gfx

PucklaMotzer09 5 年之前
父節點
當前提交
c8631c21c1
共有 1 個文件被更改,包括 5 次插入12 次删除
  1. 5 12
      packages/l/libsdl_gfx/xmake.lua

+ 5 - 12
packages/l/libsdl_gfx/xmake.lua

@@ -26,28 +26,21 @@ package("libsdl_gfx")
     on_install("windows", function(package)
         local file_name = "SDL2_gfx.vcxproj"
         local content = io.readfile(file_name)
-
         content = content:gsub("%%%(AdditionalIncludeDirectories%)", package:dep("libsdl"):installdir("include", "SDL2") .. ";%%%(AdditionalIncludeDirectories%)")
         content = content:gsub("%%%(AdditionalLibraryDirectories%)", package:dep("libsdl"):installdir("lib") .. ";%%%(AdditionalLibraryDirectories%)")
-
         io.writefile(file_name, content)
 
         local configs = {}
-        local build_dir = ""
-
-        if package:arch() == "x86" then
-            build_dir = "Win32"
-        else
-            build_dir = "x64"
-        end
+        local arch = package:is_arch("x86") and "Win32" or "x64"
+        local mode = package:debug() and "Debug" or "Release"
 
-        table.insert(configs, "/property:Configuration=Release")
-        table.insert(configs, "/property:Platform=" .. build_dir)
+        table.insert(configs, "/property:Configuration=" .. mode)
+        table.insert(configs, "/property:Platform=" .. arch)
         table.insert(configs, "-target:SDL2_gfx")
 
         import("package.tools.msbuild").build(package, configs)
 
-        build_dir = path.join(build_dir, "Release")
+        local build_dir = path.join(arch, mode)
         os.cp(path.join(build_dir, "*.lib"), package:installdir("lib"))
         os.cp(path.join(build_dir, "*.dll"), package:installdir("lib"))
         os.cp("*.h", package:installdir("include", "SDL2"))