Bladeren bron

Fixed the issue where OptiX could not correctly find the specified ve… (#5588)

Co-authored-by: youwen.zhuang <[email protected]>
Xdestiny 10 maanden geleden
bovenliggende
commit
e328ef3c5c
1 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 4 1
      packages/o/optix/xmake.lua

+ 4 - 1
packages/o/optix/xmake.lua

@@ -6,11 +6,14 @@ package("optix")
     on_fetch(function (package, opt)
     on_fetch(function (package, opt)
         if opt.system then
         if opt.system then
             import("lib.detect.find_path")
             import("lib.detect.find_path")
+            import("core.base.semver")
 
 
             local paths = {"$(env OptiX_ROOT)"}
             local paths = {"$(env OptiX_ROOT)"}
             if package:is_plat("windows") then
             if package:is_plat("windows") then
                 for _, dir in ipairs(os.dirs("$(env PROGRAMDATA)/NVIDIA Corporation/OptiX SDK *.*.*")) do
                 for _, dir in ipairs(os.dirs("$(env PROGRAMDATA)/NVIDIA Corporation/OptiX SDK *.*.*")) do
-                    table.insert(paths, dir)
+                    if package:version_str() == "latest" or semver.satisfies(dir:match("OptiX SDK (%d+%.%d+%.%d+)"), package:version_str()) then
+                        table.insert(paths, dir)
+                    end
                 end
                 end
             end
             end