Browse Source

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 <[email protected]>
Altina Orion 1 year ago
parent
commit
51347e95cb
1 changed files with 5 additions and 7 deletions
  1. 5 7
      packages/t/tbb/fetch.lua

+ 5 - 7
packages/t/tbb/fetch.lua

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