summaryrefslogtreecommitdiffstats
path: root/premake5.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--premake5.lua93
1 files changed, 60 insertions, 33 deletions
diff --git a/premake5.lua b/premake5.lua
index 173fe3e4..f2a58880 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -1,5 +1,7 @@
+Librw = os.getenv("LIBRW") or "librw"
+
workspace "re3"
- configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW" }
+ configurations { "Debug", "Release", "ReleaseFH", "DebugRW", "ReleaseRW", "ReleaseGLFW" }
location "build"
files { "src/*.*" }
@@ -17,9 +19,11 @@ workspace "re3"
files { "src/save/*.*" }
files { "src/skel/*.*" }
files { "src/skel/win/*.*" }
+ files { "src/skel/glfw/*.*" }
files { "src/text/*.*" }
files { "src/vehicles/*.*" }
files { "src/weapons/*.*" }
+ files { "src/extras/*.*" }
files { "eax/*.*" }
includedirs { "src" }
@@ -37,23 +41,48 @@ workspace "re3"
includedirs { "src/save/" }
includedirs { "src/skel/" }
includedirs { "src/skel/win" }
+ includedirs { "src/skel/glfw" }
includedirs { "src/text" }
includedirs { "src/vehicles" }
includedirs { "src/weapons" }
+ includedirs { "src/extras" }
includedirs { "eax" }
includedirs { "dxsdk/include" }
- includedirs { "rwsdk/include/d3d8" }
includedirs { "milessdk/include" }
includedirs { "eax" }
libdirs { "dxsdk/lib" }
libdirs { "milessdk/lib" }
- filter "configurations:DebugRW or configurations:ReleaseRW"
- defines { "RWLIBS" }
- libdirs { "rwsdk/lib/d3d8/release" }
- links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp" }
+ filter "configurations:Debug or Release"
+ files { "src/fakerw/*.*" }
+ includedirs { "src/fakerw" }
+ includedirs { Librw }
+ libdirs { path.join(Librw, "lib/win-x86-d3d9/%{cfg.buildcfg}") }
+ links { "rw", "d3d9" }
+ filter {}
+
+ filter "configurations:DebugRW or ReleaseRW"
+ includedirs { "rwsdk/include/d3d8" }
+ libdirs { "rwsdk/lib/d3d8/release" }
+ links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp", "rtquat", "rtcharse" }
+ filter {}
+
+ filter "configurations:ReleaseGLFW"
+ defines { "GLEW_STATIC", "GLFW_DLL" }
+ files { "src/fakerw/*.*" }
+ includedirs { "src/fakerw" }
+ includedirs { Librw }
+ includedirs { "glfw-3.3.2.bin.WIN32/include" }
+ includedirs { "glew-2.1.0/include" }
+ libdirs { path.join(Librw, "lib/win-x86-gl3/Release") }
+ libdirs { "glew-2.1.0/lib/Release/Win32" }
+ libdirs { "glfw-3.3.2.bin.WIN32/lib-vc2015" }
+ links { "opengl32" }
+ links { "glew32s" }
+ links { "glfw3dll" }
+ links { "rw" }
filter {}
pbcommands = {
@@ -63,7 +92,7 @@ workspace "re3"
"set filename=%%~ni",
"set fileextension=%%~xi",
"set target=!path!!filename!!fileextension!",
- "if exist \"!target!\" copy /y \"!file!\" \"!target!\"",
+ "copy /y \"!file!\" \"!target!\"",
")" }
function setpaths (gamepath, exepath, scriptspath)
@@ -83,43 +112,41 @@ workspace "re3"
end
project "re3"
- kind "SharedLib"
+ kind "WindowedApp"
language "C++"
targetname "re3"
targetdir "bin/%{cfg.buildcfg}"
- targetextension ".dll"
+ targetextension ".exe"
characterset ("MBCS")
linkoptions "/SAFESEH:NO"
-
- filter "configurations:Debug"
- defines { "DEBUG" }
+
+ setpaths("$(GTA_III_RE_DIR)/", "$(TargetFileName)", "")
+ symbols "Full"
+ staticruntime "off"
+
+ filter "configurations:Debug or Release or ReleaseFH"
+ prebuildcommands { "cd \"../librw\" && premake5 " .. _ACTION .. " && msbuild \"build/librw.sln\" /property:Configuration=%{cfg.longname} /property:Platform=\"win-x86-d3d9\"" }
+ defines { "LIBRW", "RW_D3D9" }
+
+ filter "configurations:*RW"
+ defines { "RWLIBS" }
staticruntime "on"
- symbols "Full"
- setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
+ linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text"
- filter "configurations:Release"
+ filter "configurations:*GLFW"
+ prebuildcommands { "cd \"../librw\" && premake5 " .. _ACTION .. " && msbuild \"build/librw.sln\" /property:Configuration=Release /property:Platform=\"win-x86-gl3\"" }
+ defines { "LIBRW", "RW_GL3" }
+
+ filter "configurations:Debug*"
+ defines { "DEBUG" }
+
+ filter "configurations:Release*"
defines { "NDEBUG" }
optimize "On"
- staticruntime "on"
- symbols "Full"
- setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
+
filter "configurations:ReleaseFH"
- defines { "NDEBUG" }
- symbols "Full"
+ prebuildcommands {}
optimize "off"
staticruntime "on"
- targetextension ".asi"
- setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "scripts/")
- filter "configurations:DebugRW"
- defines { "DEBUG" }
- staticruntime "on"
- symbols "On"
- setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
-
- filter "configurations:ReleaseRW"
- defines { "NDEBUG" }
- optimize "On"
- staticruntime "on"
- setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")