|
@@ -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
|
|
|
|
|