embree 3.5.0 (new formula)
Closes #37655. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
4050d7cca8
commit
796cbbeb34
1 changed files with 49 additions and 0 deletions
49
Formula/embree.rb
Normal file
49
Formula/embree.rb
Normal file
|
@ -0,0 +1,49 @@
|
|||
class Embree < Formula
|
||||
desc "High-performance ray tracing kernels"
|
||||
homepage "https://embree.github.io/"
|
||||
url "https://github.com/embree/embree/archive/v3.5.0.tar.gz"
|
||||
sha256 "4635439c277d0f688f1a21ad13ad22fdadbcbca04680cce346c88179b9522741"
|
||||
head "https://github.com/embree/embree.git"
|
||||
|
||||
depends_on "cmake" => :build
|
||||
depends_on "ispc" => :build
|
||||
depends_on "tbb"
|
||||
|
||||
def install
|
||||
max_isa = MacOS.version.requires_sse42? ? "SSE4.2" : "SSE2"
|
||||
|
||||
args = std_cmake_args + %W[
|
||||
-DBUILD_TESTING=OFF
|
||||
-DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF
|
||||
-DEMBREE_ISPC_SUPPORT=ON
|
||||
-DEMBREE_MAX_ISA=#{max_isa}
|
||||
-DEMBREE_TUTORIALS=OFF
|
||||
]
|
||||
|
||||
mkdir "build" do
|
||||
system "cmake", *args, ".."
|
||||
system "make"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
# Remove bin/models directory and the resultant empty bin directory since
|
||||
# tutorials are not enabled.
|
||||
rm_rf bin
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.c").write <<~EOS
|
||||
#include <assert.h>
|
||||
#include <embree3/rtcore.h>
|
||||
int main() {
|
||||
RTCDevice device = rtcNewDevice("verbose=1");
|
||||
assert(device != 0);
|
||||
rtcReleaseDevice(device);
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
|
||||
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lembree3"
|
||||
system "./a.out"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue