diff --git a/packages/o/optix/xmake.lua b/packages/o/optix/xmake.lua index 30afaaec7..80966f025 100644 --- a/packages/o/optix/xmake.lua +++ b/packages/o/optix/xmake.lua @@ -6,11 +6,14 @@ package("optix") on_fetch(function (package, opt) if opt.system then import("lib.detect.find_path") + import("core.base.semver") local paths = {"$(env OptiX_ROOT)"} if package:is_plat("windows") then 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