|
@@ -5,11 +5,13 @@ package("tbb")
|
|
|
|
|
|
if is_plat("windows") then
|
|
if is_plat("windows") then
|
|
-- use precompiled binary
|
|
-- use precompiled binary
|
|
- add_urls("https://github.com/oneapi-src/oneTBB/releases/download/v$(version)/tbb-$(version)-win.zip")
|
|
|
|
|
|
+ add_urls("https://github.com/oneapi-src/oneTBB/releases/download/v$(version)-win.zip", {version = function (version) return version .. (version:ge("2021.0") and "/oneapi-tbb-" or "/tbb-") .. version end})
|
|
add_versions("2020.3", "cda37eed5209746a79c88a658f8c1bf3782f58bd9f9f6ba0da3a16624a9bfaa1")
|
|
add_versions("2020.3", "cda37eed5209746a79c88a658f8c1bf3782f58bd9f9f6ba0da3a16624a9bfaa1")
|
|
|
|
+ add_versions("2021.2.0", "9be37b1cb604a5905db0a15b2b893d85579fd0b2f1024859e1f75e96d7331a02")
|
|
else
|
|
else
|
|
add_urls("https://github.com/oneapi-src/oneTBB/archive/v$(version).tar.gz")
|
|
add_urls("https://github.com/oneapi-src/oneTBB/archive/v$(version).tar.gz")
|
|
add_versions("2020.3", "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3")
|
|
add_versions("2020.3", "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3")
|
|
|
|
+ add_versions("2021.2.0", "cee20b0a71d977416f3e3b4ec643ee4f38cedeb2a9ff015303431dd9d8d79854")
|
|
|
|
|
|
if is_plat("macosx") then
|
|
if is_plat("macosx") then
|
|
add_configs("compiler", {description = "Compiler used to compile tbb." , default = "clang", type = "string", values = {"clang", "gcc", "icc", "cl", "icl", "[others]"}})
|
|
add_configs("compiler", {description = "Compiler used to compile tbb." , default = "clang", type = "string", values = {"clang", "gcc", "icc", "cl", "icl", "[others]"}})
|
|
@@ -18,29 +20,50 @@ package("tbb")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+ on_fetch("fetch")
|
|
|
|
+
|
|
|
|
+ add_links("tbb", "tbbmalloc", "tbbmalloc_proxy")
|
|
|
|
+
|
|
|
|
+ on_load("macosx", "linux", "mingw@windows", "mingw@msys", function (package)
|
|
|
|
+ if package:version():ge("2021.0") then
|
|
|
|
+ package:add("deps", "cmake")
|
|
|
|
+ end
|
|
|
|
+ end)
|
|
|
|
+
|
|
on_install("macosx", "linux", "mingw@windows", "mingw@msys", function (package)
|
|
on_install("macosx", "linux", "mingw@windows", "mingw@msys", function (package)
|
|
- local configs = {"-j4", "tbb_build_prefix=build_dir"}
|
|
|
|
- local cfg = package:debug() and "debug" or "release"
|
|
|
|
- table.insert(configs, "cfg=" .. cfg)
|
|
|
|
- table.insert(configs, "arch=" .. (package:is_arch("x86_64") and "intel64" or "ia32"))
|
|
|
|
- table.insert(configs, "compiler=" .. (package:config("compiler")))
|
|
|
|
- if package:is_plat("mingw") then
|
|
|
|
- os.vrunv("mingw32-make", configs)
|
|
|
|
|
|
+ if package:version():ge("2021.0") then
|
|
|
|
+ if package:is_plat("mingw") then
|
|
|
|
+ raise("mingw build is not supported in this version")
|
|
|
|
+ end
|
|
|
|
+ local configs = {"-DTBB_TEST=OFF"}
|
|
|
|
+ table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
|
+ import("package.tools.cmake").install(package, configs)
|
|
else
|
|
else
|
|
- os.vrunv("make", configs)
|
|
|
|
- end
|
|
|
|
- os.cp("include", package:installdir())
|
|
|
|
- os.rm("build/build_dir_" .. cfg .. "/*.d")
|
|
|
|
- os.rm("build/build_dir_" .. cfg .. "/*.o")
|
|
|
|
- os.cp("build/build_dir_" .. cfg .. "/**", package:installdir("lib"))
|
|
|
|
- if package:is_plat("mingw") then
|
|
|
|
- package:addenv("PATH", "lib")
|
|
|
|
|
|
+ local configs = {"-j4", "tbb_build_prefix=build_dir"}
|
|
|
|
+ local cfg = package:debug() and "debug" or "release"
|
|
|
|
+ table.insert(configs, "cfg=" .. cfg)
|
|
|
|
+ table.insert(configs, "arch=" .. (package:is_arch("x86_64") and "intel64" or "ia32"))
|
|
|
|
+ table.insert(configs, "compiler=" .. (package:config("compiler")))
|
|
|
|
+ if package:is_plat("mingw") then
|
|
|
|
+ os.vrunv("mingw32-make", configs)
|
|
|
|
+ else
|
|
|
|
+ os.vrunv("make", configs)
|
|
|
|
+ end
|
|
|
|
+ os.cp("include", package:installdir())
|
|
|
|
+ os.rm("build/build_dir_" .. cfg .. "/*.d")
|
|
|
|
+ os.rm("build/build_dir_" .. cfg .. "/*.o")
|
|
|
|
+ os.cp("build/build_dir_" .. cfg .. "/**", package:installdir("lib"))
|
|
|
|
+ if package:is_plat("mingw") then
|
|
|
|
+ package:addenv("PATH", "lib")
|
|
|
|
+ end
|
|
end
|
|
end
|
|
- package:add("links", "tbb", "tbbmalloc")
|
|
|
|
end)
|
|
end)
|
|
|
|
|
|
on_install("windows", function (package)
|
|
on_install("windows", function (package)
|
|
- os.cp("tbb/include", package:installdir())
|
|
|
|
|
|
+ local incdir = (package:version():ge("2021.0") and "include" or "tbb/include")
|
|
|
|
+ local libdir = (package:version():ge("2021.0") and "lib/" or "tbb/lib/")
|
|
|
|
+ local bindir = (package:version():ge("2021.0") and "redist/" or "tbb/bin/")
|
|
|
|
+ os.cp(incdir, package:installdir())
|
|
local prefix = ""
|
|
local prefix = ""
|
|
if package:is_arch("x64", "x86_64") then
|
|
if package:is_arch("x64", "x86_64") then
|
|
prefix = "intel64/vc14"
|
|
prefix = "intel64/vc14"
|
|
@@ -48,11 +71,11 @@ package("tbb")
|
|
prefix = "ia32/vc14"
|
|
prefix = "ia32/vc14"
|
|
end
|
|
end
|
|
if package:config("debug") then
|
|
if package:config("debug") then
|
|
- os.cp("tbb/lib/" .. prefix .. "/*_debug.*", package:installdir("lib"))
|
|
|
|
- os.cp("tbb/bin/" .. prefix .. "/*_debug.*", package:installdir("bin"))
|
|
|
|
|
|
+ os.cp(libdir .. prefix .. "/*_debug.*", package:installdir("lib"))
|
|
|
|
+ os.cp(bindir .. prefix .. "/*_debug.*", package:installdir("bin"))
|
|
else
|
|
else
|
|
- os.cp("tbb/lib/" .. prefix .. "/**|*_debug.*", package:installdir("lib"))
|
|
|
|
- os.cp("tbb/bin/" .. prefix .. "/**|*_debug.*", package:installdir("bin"))
|
|
|
|
|
|
+ os.cp(libdir .. prefix .. "/**|*_debug.*", package:installdir("lib"))
|
|
|
|
+ os.cp(bindir .. prefix .. "/**|*_debug.*", package:installdir("bin"))
|
|
end
|
|
end
|
|
package:addenv("PATH", "bin")
|
|
package:addenv("PATH", "bin")
|
|
end)
|
|
end)
|