Browse Source

vc-ltl5: add deps for windows xp version (#6296)

star9029 6 months ago
parent
commit
4badd8d9c4
1 changed files with 11 additions and 4 deletions
  1. 11 4
      packages/v/vc-ltl5/xmake.lua

+ 11 - 4
packages/v/vc-ltl5/xmake.lua

@@ -24,20 +24,26 @@ package("vc-ltl5")
 
     add_configs("min_version", {description = "Windows Target Platform Min Version", default = default_min_version, type = "string"})
     add_configs("subsystem", {description = "Windows xp subsystem", default = "windows", type = "string", values = {"console", "windows"}})
-    add_configs("clean_import", {description = "Do not use ucrt apiset, such as api-ms-win-crt-time-l1-1-0.dll (for geeks)", default = false, type = "boolean"})
+    add_configs("clean_import", {description = "Do not use ucrt apiset, such as api-ms-win-crt-time-l1-1-0.dll (for geeks) (Duplicated after vc-ltl 5.1 version)", default = false, type = "boolean"})
     add_configs("openmp", {description = "Use openmp library", default = false, type = "boolean", readonly = true})
     add_configs("shared", {description = "Use vs_runtime", default = true, type = "boolean", readonly = true})
     add_configs("debug", {description = "Use vs_runtime", default = true, type = "boolean", readonly = true})
 
-    on_load("windows", function (package)
-        import("core.tool.toolchain")
+    set_policy("package.precompiled", false)
+
+    on_load(function (package)
         -- check vs version
-        local vs = toolchain.load("msvc"):config("vs")
+        local vs = package:toolchain("msvc"):config("vs")
         if vs and tonumber(vs) < 2015 then
             cprint("${color.warning}vc-ltl5 only supports vc14.0 or later versions")
         end
         -- is xp?
         if package:config("min_version"):startswith("5") then
+            if package:version():ge("5.1.0") then
+                package:add("deps", "yy-thunks")
+                wprint([[package(vc-ltl5 >=5.1) require yy-thunks, you need to use `add_rules("yy-thunks@xp")` for windows xp target]])
+            end
+
             if package:config("vs_runtime"):startswith("MD") then
                 package:add("cxflags", "/Zc:threadSafeInit-")
             end
@@ -112,6 +118,7 @@ package("vc-ltl5")
         ]])
         import("package.tools.xmake").install(package)
 
+        -- Duplicated after vc-ltl 5.1 version
         local clean_import_dir = libdir .. "/CleanImport"
         if package:config("clean_import") and os.isdir(clean_import_dir) then
             os.cp(clean_import_dir, package:installdir("lib"))