summaryrefslogtreecommitdiffstats
path: root/premake5.lua
diff options
context:
space:
mode:
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua47
1 files changed, 24 insertions, 23 deletions
diff --git a/premake5.lua b/premake5.lua
index 010810a0..af64958e 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -1,11 +1,4 @@
newoption {
- trigger = "glewdir",
- value = "PATH",
- description = "Directory of GLEW",
- default = "vendor/glew-2.1.0"
-}
-
-newoption {
trigger = "glfwdir64",
value = "PATH",
description = "Directory of glfw",
@@ -65,7 +58,7 @@ end
workspace "reLCS"
language "C++"
- configurations { "Debug", "Release" }
+ configurations { "Debug", "Release", "Vanilla" }
startproject "reLCS"
location "build"
symbols "Full"
@@ -120,13 +113,16 @@ workspace "reLCS"
filter "configurations:Debug"
defines { "DEBUG" }
- filter "configurations:Release"
+ filter "configurations:not Debug"
defines { "NDEBUG" }
optimize "Speed"
if(_OPTIONS["lto"]) then
flags { "LinkTimeOptimization" }
end
+ filter "configurations:Vanilla"
+ defines { "VANILLA_DEFINES" }
+
filter { "platforms:win*" }
system "windows"
@@ -162,7 +158,6 @@ workspace "reLCS"
filter "platforms:*librw_gl3_glfw*"
defines { "RW_GL3" }
- includedirs { path.join(_OPTIONS["glewdir"], "include") }
if(not _OPTIONS["with-librw"]) then
libdirs { path.join(Librw, "lib/%{getsys(cfg.system)}-%{getarch(cfg.architecture)}-gl3/%{cfg.buildcfg}") }
end
@@ -173,9 +168,6 @@ workspace "reLCS"
filter "platforms:*amd64-librw_gl3_glfw*"
includedirs { path.join(_OPTIONS["glfwdir64"], "include") }
- filter "platforms:win*librw_gl3_glfw*"
- defines { "GLEW_STATIC" }
-
filter {}
function setpaths (gamepath, exepath)
@@ -200,6 +192,7 @@ project "librw"
targetdir(path.join(Librw, "lib/%{cfg.platform}/%{cfg.buildcfg}"))
files { path.join(Librw, "src/*.*") }
files { path.join(Librw, "src/*/*.*") }
+ files { path.join(Librw, "src/gl/*/*.*") }
filter { "platforms:*x86*" }
architecture "x86"
@@ -208,6 +201,7 @@ project "librw"
architecture "amd64"
filter "platforms:win*"
+ defines { "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE" }
staticruntime "on"
buildoptions { "/Zc:sizedDealloc-" }
@@ -239,6 +233,10 @@ project "reLCS"
targetname "reLCS"
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
+ if(_OPTIONS["with-librw"]) then
+ dependson "librw"
+ end
+
files { addSrcFiles("src") }
files { addSrcFiles("src/animation") }
files { addSrcFiles("src/audio") }
@@ -264,6 +262,7 @@ project "reLCS"
files { addSrcFiles("src/vehicles") }
files { addSrcFiles("src/weapons") }
files { addSrcFiles("src/extras") }
+ files { "src/extras/GitSHA1.cpp" } -- this won't be in repo in first build
includedirs { "src" }
includedirs { "src/animation" }
@@ -316,7 +315,7 @@ project "reLCS"
filter {}
if(os.getenv("GTA_LCS_RE_DIR")) then
- setpaths("$(GTA_LCS_RE_DIR)/", "%(cfg.buildtarget.name)")
+ setpaths(os.getenv("GTA_LCS_RE_DIR") .. "/", "%(cfg.buildtarget.name)")
end
filter "platforms:win*"
@@ -330,6 +329,10 @@ project "reLCS"
-- external librw is dynamic
staticruntime "on"
end
+ prebuildcommands { '"%{prj.location}..\\printHash.bat" "%{prj.location}..\\src\\extras\\GitSHA1.cpp"' }
+
+ filter "platforms:not win*"
+ prebuildcommands { '"%{prj.location}/../printHash.sh" "%{prj.location}/../src/extras/GitSHA1.cpp"' }
filter "platforms:win*glfw*"
staticruntime "off"
@@ -350,10 +353,10 @@ project "reLCS"
libdirs { "vendor/openal-soft/libs/Win64" }
filter "platforms:linux*oal"
- links { "openal", "mpg123", "sndfile", "pthread" }
+ links { "openal", "mpg123", "sndfile", "pthread", "X11" }
filter "platforms:bsd*oal"
- links { "openal", "mpg123", "sndfile", "pthread" }
+ links { "openal", "mpg123", "sndfile", "pthread", "X11" }
filter "platforms:macosx*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
@@ -393,25 +396,23 @@ project "reLCS"
libdirs { "sdk/dx8sdk/lib" }
filter "platforms:win-x86*gl3_glfw*"
- libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") }
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
- links { "opengl32", "glew32s", "glfw3" }
+ links { "opengl32", "glfw3" }
filter "platforms:win-amd64*gl3_glfw*"
- libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/x64") }
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-" .. string.gsub(_ACTION or '', "vs", "vc")) }
- links { "opengl32", "glew32s", "glfw3" }
+ links { "opengl32", "glfw3" }
filter "platforms:linux*gl3_glfw*"
- links { "GL", "GLEW", "glfw" }
+ links { "GL", "glfw" }
filter "platforms:bsd*gl3_glfw*"
- links { "GL", "GLEW", "glfw", "sysinfo" }
+ links { "GL", "glfw", "sysinfo" }
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
filter "platforms:macosx*gl3_glfw*"
- links { "GLEW", "glfw" }
+ links { "glfw" }
linkoptions { "-framework OpenGL" }
includedirs { "/opt/local/include" }
includedirs { "/usr/local/include" }