jthread 1.3.3 (new formula)
Closes #25063. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
0dfdc46b4b
commit
4b3d4180ea
1 changed files with 33 additions and 0 deletions
33
Formula/jthread.rb
Normal file
33
Formula/jthread.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
class Jthread < Formula
|
||||
desc "C++ class to make use of threads easy"
|
||||
homepage "https://research.edm.uhasselt.be/jori/jthread"
|
||||
url "https://research.edm.uhasselt.be/jori/jthread/jthread-1.3.3.tar.bz2"
|
||||
sha256 "17560e8f63fa4df11c3712a304ded85870227b2710a2f39692133d354ea0b64f"
|
||||
|
||||
depends_on "cmake" => :build
|
||||
depends_on "pkg-config" => :build
|
||||
|
||||
def install
|
||||
system "cmake", ".", *std_cmake_args
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.cpp").write <<~EOS
|
||||
#include <jthread/jthread.h>
|
||||
using namespace jthread;
|
||||
|
||||
int main() {
|
||||
JMutex* jm = new JMutex();
|
||||
jm->Init();
|
||||
jm->Lock();
|
||||
jm->Unlock();
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
|
||||
system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-ljthread",
|
||||
"-o", "test"
|
||||
system "./test"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue