42 lines
1.2 KiB
Ruby
42 lines
1.2 KiB
Ruby
class Nanoflann < Formula
|
|
desc "Header-only library for Nearest Neighbor search wih KD-trees"
|
|
homepage "https://github.com/jlblancoc/nanoflann"
|
|
url "https://github.com/jlblancoc/nanoflann/archive/v1.4.0.tar.gz"
|
|
sha256 "9ce09aa7c049e28ca4e2fbeffafc8e09aca98a52624578798c8ebb723ad974bb"
|
|
license "BSD-3-Clause"
|
|
head "https://github.com/jlblancoc/nanoflann.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "4d2dec9b2bec558a840870189d0fa5d7af2d9ff0d84d7839381987087cf7008d"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
on_macos do
|
|
depends_on "gcc" => [:build, :test] if DevelopmentTools.clang_build_version <= 1200
|
|
end
|
|
|
|
fails_with :clang do
|
|
build 1200
|
|
cause "https://bugs.llvm.org/show_bug.cgi?id=23029"
|
|
end
|
|
|
|
def install
|
|
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, "-DNANOFLANN_BUILD_EXAMPLES=OFF"
|
|
system "cmake", "--build", "build"
|
|
system "cmake", "--install", "build"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<~EOS
|
|
#include <nanoflann.hpp>
|
|
int main() {
|
|
nanoflann::KNNResultSet<size_t> resultSet(1);
|
|
return 0;
|
|
}
|
|
EOS
|
|
system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11"
|
|
system "./test"
|
|
end
|
|
end
|