aboutsummaryrefslogtreecommitdiff
path: root/platforms/premake/premake4.lua
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
commitc068f22329d5cc722622a2183bbb22eef2093df7 (patch)
tree12d56c1aede67988a55e241364606bfbb4dba933 /platforms/premake/premake4.lua
downloadopenparsec-main.tar.xz
openparsec-main.zip
initial importHEADmain
Diffstat (limited to 'platforms/premake/premake4.lua')
-rw-r--r--platforms/premake/premake4.lua101
1 files changed, 101 insertions, 0 deletions
diff --git a/platforms/premake/premake4.lua b/platforms/premake/premake4.lua
new file mode 100644
index 0000000..4e58f21
--- /dev/null
+++ b/platforms/premake/premake4.lua
@@ -0,0 +1,101 @@
+--[[
+ usage example:
+ premake4 gmake && make config=release server
+
+ only works with Linux for now
+]]
+
+
+local paths = {
+ --root = path.getabsolute("../../"), -- root openparsec folder
+ --premakefolder = path.getabsolute(""),
+ root = "../../",
+ premakefolder = "./"
+}
+
+paths.parsecroot = path.join(paths.root, "parsec_root")
+
+
+local srcpaths = {
+ libraries = "../../src/libraries",
+ libparsec = "../../src/libparsec",
+ parsec = "../../src/parsec",
+ parsecserver = "../../src/parsec_server",
+}
+
+
+solution "ParsecSolution"
+ language "C++"
+ platforms { "x32" }
+ includedirs { srcpaths.libraries }
+
+ configurations { "Debug", "Release" }
+
+ configuration "Debug"
+ defines { "DEBUG" }
+ flags "Symbols"
+
+ configuration "Release"
+ flags "Optimize"
+
+ configuration "linux"
+ includedirs { "/usr/include", "/usr/local/include", "/opt/include" }
+
+
+project "client"
+ kind "WindowedApp"
+ location "build/client"
+ targetdir "build/client"
+ targetname "Parsec"
+
+ defines { "PARSEC_CLIENT" }
+
+ includedirs {
+ srcpaths.libparsec.."/include",
+ srcpaths.parsec.."/include",
+ }
+
+ files {
+ srcpaths.libraries.."/**",
+ srcpaths.libparsec.."/**",
+ srcpaths.parsec.."/**",
+ }
+
+ configuration "not windows"
+ -- These are apparently windows thingies
+ excludes { srcpaths.parsec.."/**.rc" }
+
+ configuration "linux"
+ targetname "parsec"
+ links { "SDL", "SDL_mixer", "GL" }
+ postbuildcommands {
+ --("cp parsec %q"):format(paths.parsecroot.."/client/"),
+ "cp parsec ../../../../parsec_root/client/"
+ }
+
+
+project "server"
+ kind "ConsoleApp"
+ location "build/server"
+ targetdir "build/server"
+ targetname "parsec_server"
+
+ defines { "PARSEC_SERVER" }
+
+ includedirs {
+ srcpaths.libparsec.."/include",
+ srcpaths.parsecserver.."/include",
+ }
+
+ files {
+ srcpaths.libparsec.."/**",
+ srcpaths.parsecserver.."/**",
+ }
+
+ configuration "linux"
+ links { "ncurses" }
+ postbuildcommands {
+ --("cp parsec_server %q"):format(paths.parsecroot.."/server/"),
+ "cp parsec_server ../../../../parsec_root/server/"
+ }
+