|
@@ -11,6 +11,7 @@ package("embree")
|
|
|
add_versions("v3.13.3", "74ec785afb8f14d28ea5e0773544572c8df2e899caccdfc88509f1bfff58716f")
|
|
|
add_versions("v3.13.4", "e6a8d1d4742f60ae4d936702dd377bc4577a3b034e2909adb2197d0648b1cb35")
|
|
|
add_versions("v3.13.5", "b8c22d275d9128741265537c559d0ea73074adbf2f2b66b0a766ca52c52d665b")
|
|
|
+ add_versions("v4.3.0", "baf0a57a45837fc055ba828a139467bce0bc0c6a9a5f2dccb05163d012c12308")
|
|
|
|
|
|
-- Not recommanded to build embree as a static library.
|
|
|
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
|
|
@@ -19,9 +20,11 @@ package("embree")
|
|
|
if is_plat("windows") then
|
|
|
add_syslinks("advapi32")
|
|
|
end
|
|
|
- add_links("embree3", "embree_sse42", "embree_avx", "embree_avx2", "embree_avx512", "tasking", "simd", "lexers", "math", "sys")
|
|
|
|
|
|
on_install("macosx", "linux", "windows|x64", "windows|x86", function (package)
|
|
|
+ if package:version():lt("4.0.0") then
|
|
|
+ package:add("links", "embree3", "embree_sse42", "embree_avx", "embree_avx2", "embree_avx512", "tasking", "simd", "lexers", "math", "sys")
|
|
|
+ end
|
|
|
io.replace("common/tasking/CMakeLists.txt", "include(installTBB)", "", {plain = true})
|
|
|
local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOC=OFF", "-DEMBREE_TUTORIALS=OFF", "-DEMBREE_ISPC_SUPPORT=OFF"}
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
@@ -36,11 +39,13 @@ package("embree")
|
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
|
+ local major_version = package:version():major()
|
|
|
+ local includes = "embree" .. major_version .. "/rtcore.h"
|
|
|
assert(package:check_cxxsnippets({test = [[
|
|
|
#include <cassert>
|
|
|
void test() {
|
|
|
RTCDevice device = rtcNewDevice(NULL);
|
|
|
assert(device != NULL);
|
|
|
}
|
|
|
- ]]}, {configs = {languages = "c++11"}, includes = "embree3/rtcore.h"}))
|
|
|
+ ]]}, {configs = {languages = "c++11"}, includes = includes}))
|
|
|
end)
|