about summary refs log tree commit diff stats
path: root/premake5.lua
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-06-07 03:05:54 -0400
committerCharadon <dev@iotib.net>2022-06-07 03:05:54 -0400
commit8a44e0f5d5d9d11fd6b7bc4a5346c5e9b17db739 (patch)
tree8f7069ce77de02396f337c68b628fa69ffef962e /premake5.lua
parente1d99fb48bc66150d58ef528eb0594c9df07b572 (diff)
downloadPong-C-8a44e0f5d5d9d11fd6b7bc4a5346c5e9b17db739.tar.gz
Did some stuff with flatpak
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua35
1 files changed, 30 insertions, 5 deletions
diff --git a/premake5.lua b/premake5.lua
index 310499f..be84cff 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -29,6 +29,24 @@ project("Pong")
             os.exit(0)
         end
     }
+
+    newaction {
+        trigger = "check_deps",
+        description = "Check if you have all the dependencies installed.",
+        execute = function()
+            os.executef("rm -rvf %s/obj", _MAIN_SCRIPT_DIR)
+            os.executef("rm -rvf %s/bin", _MAIN_SCRIPT_DIR)
+            os.executef("rm -rvf %s/app", _MAIN_SCRIPT_DIR)
+            os.executef("rm -vf %s/Makefile", _MAIN_SCRIPT_DIR)
+            os.executef("rm -vf %s/Pong.make", _MAIN_SCRIPT_DIR)
+            os.executef("rm -rvf %s/flatpak_repo", _MAIN_SCRIPT_DIR)
+            os.executef("rm -rvf %s/.flatpak-builder", _MAIN_SCRIPT_DIR)
+            os.executef("rm -rvf %s/build-dir", _MAIN_SCRIPT_DIR)
+            os.executef("rm -vf %s/*.flatpak", _MAIN_SCRIPT_DIR)
+            os.exit(0)
+        end
+    }
+
     kind("WindowedApp")
     language("C")
     files {"src/*.c", "src/*.h", }
@@ -50,13 +68,20 @@ project("Pong")
     }
     flatpak = _OPTIONS["flatpak"] or "false"
 
-    -- Find raylib
-    RaylibStaticLibrary = os.findlib("libraylib.a", {"raylib", "raylib/src"})
-    if(RaylibStaticLibrary == nil) then
+    -- Check for pkgconf
+    Pkgconf_Result = os.executef("pkgconf --version")
+    if(Pkgconf_Result == nil)
+    then
+        print("You do not have pkgconf installed. Aborting.")
         os.exit(1)
     end
-    libdirs {RaylibStaticLibrary}
-    linkoptions {"`pkgconf --libs glfw3`", "`pkgconf --libs gl`"}
+
+    if (flatpak == true)
+    then
+        linkoptions {"-L/app/lib"}
+    end
+
+    linkoptions {"-lraylib", "`pkgconf --libs glfw3`", "`pkgconf --libs gl`", "`pkgconf --libs sdl2`", "`pkgconf --libs SDL2_mixer`"}
 
     -- Detect OS
     if(os.ishost("linux") == true) then