Update TBB fetch.lua (#4317)

* Update fetch.lua

replace \\ with / for Linux path compatibility

* Update fetch.lua

* change outdated "intel64" flag to "x86_64"

* Update fetch.lua

---------

Co-authored-by: ruki <waruqi@gmail.com>
pull/4329/head
Altina Orion 6 months ago committed by GitHub
parent 141469c2ae
commit 51347e95cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      packages/t/tbb/fetch.lua

@ -1,11 +1,11 @@
import("lib.detect.find_path") import("lib.detect.find_path")
import("lib.detect.find_library") import("lib.detect.find_library")
function _find_package_on_windows(package, opt) function _find_package(package, opt)
local rdir = (package:is_arch("x64") and "intel64" or "ia32") local rdir = (package:is_arch("x64", "x86_64") and "intel64" or "ia32")
local paths = { local paths = {
"$(env TBB_ROOT)", "$(env TBB_ROOT)",
"$(env ONEAPI_ROOT)\\tbb\\latest" "$(env ONEAPI_ROOT)/tbb/latest"
} }
-- find includes and links -- find includes and links
@ -22,7 +22,6 @@ function _find_package_on_windows(package, opt)
if incpath then if incpath then
table.insert(result.includedirs, incpath) table.insert(result.includedirs, incpath)
end end
if #result.includedirs > 0 and #result.linkdirs > 0 then if #result.includedirs > 0 and #result.linkdirs > 0 then
local version_file = path.join(incpath, "oneapi", "tbb", "version.h") local version_file = path.join(incpath, "oneapi", "tbb", "version.h")
if not os.isfile(version_file) then if not os.isfile(version_file) then
@ -47,9 +46,8 @@ end
function main(package, opt) function main(package, opt)
if opt.system and package.find_package then if opt.system and package.find_package then
local result local result
if package:is_plat("windows") then result = _find_package(package, opt)
result = _find_package_on_windows(package, opt)
end
if not result then if not result then
result = package:find_package("tbb", opt) result = package:find_package("tbb", opt)
end end

Loading…
Cancel
Save