glbinding: allow building static libraries (#14728)

master
Jan Rüegg 2017-06-21 23:40:38 +02:00 committed by JCount
parent 451b549d74
commit 78648d188b
1 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ class Glbinding < Formula
end end
option "with-glfw", "Enable tools that display OpenGL information for your system" option "with-glfw", "Enable tools that display OpenGL information for your system"
option "with-static", "Build static instead of shared glbinding libraries"
depends_on "cmake" => :build depends_on "cmake" => :build
depends_on "glfw" => :optional depends_on "glfw" => :optional
@ -21,6 +22,7 @@ class Glbinding < Formula
ENV.cxx11 ENV.cxx11
args = std_cmake_args args = std_cmake_args
args << "-DGLFW_LIBRARY_RELEASE=" if build.without? "glfw" args << "-DGLFW_LIBRARY_RELEASE=" if build.without? "glfw"
args << "-DBUILD_SHARED_LIBS:BOOL=OFF" if build.with? "static"
system "cmake", ".", *args system "cmake", ".", *args
system "cmake", "--build", ".", "--target", "install" system "cmake", "--build", ".", "--target", "install"
end end
@ -35,7 +37,7 @@ class Glbinding < Formula
} }
EOS EOS
system ENV.cxx, "-o", "test", "test.cpp", "-std=c++11", "-stdlib=libc++", system ENV.cxx, "-o", "test", "test.cpp", "-std=c++11", "-stdlib=libc++",
"-I#{include}/glbinding", "-I#{lib}/glbinding", "-I#{include}/glbinding", "-I#{lib}/glbinding", "-framework", "OpenGL",
"-lglbinding", *ENV.cflags.to_s.split "-lglbinding", *ENV.cflags.to_s.split
system "./test" system "./test"
end end