Skip to content

Commit

Permalink
tgui: use sfml
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Jan 11, 2025
1 parent 2b6cd27 commit 1d70a73
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Formula/t/tgui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Tgui < Formula
end

depends_on "cmake" => :build
depends_on "sfml@2" # sfml 3.0 build issue report, https://github.com/texus/TGUI/issues/249
depends_on "sfml"

def install
args = %W[
Expand All @@ -45,15 +45,19 @@ def install
#include <TGUI/Backend/SFML-Graphics.hpp>
int main()
{
sf::Text text;
text.setString("Hello World");
sf::RenderWindow window{sf::VideoMode{{800, 600}}, "TGUI example (SFML-Graphics)"};
tgui::Gui gui{window};
if (!window.isOpen())
return 1;
const auto event = window.pollEvent();
sf::sleep(sf::seconds(2));
window.close();
return 0;
}
CPP

ENV.append_path "LD_LIBRARY_PATH", Formula["sfml@2"].opt_lib if OS.linux?
system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-I#{Formula["sfml@2"].opt_include}",
"-L#{lib}", "-L#{Formula["sfml@2"].opt_lib}",
system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-I#{Formula["sfml"].opt_include}",
"-L#{lib}", "-L#{Formula["sfml"].opt_lib}",
"-ltgui", "-lsfml-graphics", "-lsfml-system", "-lsfml-window",
"-o", "test"
system "./test"
Expand Down

0 comments on commit 1d70a73

Please sign in to comment.