summaryrefslogtreecommitdiff
path: root/premake5.lua
diff options
context:
space:
mode:
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua31
1 files changed, 23 insertions, 8 deletions
diff --git a/premake5.lua b/premake5.lua
index 82e985f7..ebbcf4a5 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -42,6 +42,8 @@ newoption {
description = "Don't print full paths into binary"
}
+require("autoconf")
+
if(_OPTIONS["with-librw"]) then
Librw = "vendor/librw"
else
@@ -264,7 +266,7 @@ project "re3"
files { addSrcFiles("src/modelinfo") }
files { addSrcFiles("src/objects") }
files { addSrcFiles("src/peds") }
- files { addSrcFiles("src/render") }
+ files { addSrcFiles("src/renderer") }
files { addSrcFiles("src/rw") }
files { addSrcFiles("src/save") }
files { addSrcFiles("src/skel") }
@@ -293,7 +295,7 @@ project "re3"
includedirs { "src/modelinfo" }
includedirs { "src/objects" }
includedirs { "src/peds" }
- includedirs { "src/render" }
+ includedirs { "src/renderer" }
includedirs { "src/rw" }
includedirs { "src/save/" }
includedirs { "src/skel/" }
@@ -303,9 +305,6 @@ project "re3"
includedirs { "src/weapons" }
includedirs { "src/extras" }
- filter "configurations:Vanilla"
- defines { "VANILLA_DEFINES" }
-
if(not _OPTIONS["no-git-hash"]) then
defines { "USE_OUR_VERSIONING" }
end
@@ -316,6 +315,9 @@ project "re3"
includedirs { "vendor/opusfile/include" }
end
+ filter "configurations:Vanilla"
+ defines { "VANILLA_DEFINES" }
+
filter "platforms:*mss"
defines { "AUDIO_MSS" }
includedirs { "vendor/milessdk/include" }
@@ -364,6 +366,19 @@ project "re3"
filter "platforms:win*glfw*"
staticruntime "off"
+
+ filter "platforms:*glfw*"
+ premake.modules.autoconf.parameters = "-lglfw -lX11"
+ autoconfigure {
+ -- iterates all configs and runs on them
+ ["dontWrite"] = function (cfg)
+ check_symbol_exists(cfg, "haveX11", "glfwGetX11Display", { "X11/Xlib.h", "X11/XKBlib.h", "GLFW/glfw3.h", "GLFW/glfw3native.h" }, "GLFW_EXPOSE_NATIVE_X11")
+ if cfg.autoconf["haveX11"] ~= nil and cfg.autoconf["haveX11"] == 1 then
+ table.insert(cfg.links, "X11")
+ table.insert(cfg.defines, "GET_KEYBOARD_INPUT_FROM_X11")
+ end
+ end
+ }
filter "platforms:win*oal"
includedirs { "vendor/openal-soft/include" }
@@ -381,10 +396,10 @@ project "re3"
libdirs { "vendor/openal-soft/libs/Win64" }
filter "platforms:linux*oal"
- links { "openal", "mpg123", "sndfile", "pthread", "X11" }
-
+ links { "openal", "mpg123", "sndfile", "pthread" }
+
filter "platforms:bsd*oal"
- links { "openal", "mpg123", "sndfile", "pthread", "X11" }
+ links { "openal", "mpg123", "sndfile", "pthread" }
filter "platforms:macosx*oal"
links { "openal", "mpg123", "sndfile", "pthread" }