summaryrefslogtreecommitdiffstats
path: root/premake5.lua
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-20 15:31:09 +0200
committerGitHub <noreply@github.com>2019-07-20 15:31:09 +0200
commit2d986b79d2f9b74ecbdc8b095749237f277007f9 (patch)
tree668b57f6851a885de240e84c166bf45a96347524 /premake5.lua
parentMerge pull request #154 from Nick007J/master (diff)
parentsmall cleanup (diff)
downloadre3-2d986b79d2f9b74ecbdc8b095749237f277007f9.tar
re3-2d986b79d2f9b74ecbdc8b095749237f277007f9.tar.gz
re3-2d986b79d2f9b74ecbdc8b095749237f277007f9.tar.bz2
re3-2d986b79d2f9b74ecbdc8b095749237f277007f9.tar.lz
re3-2d986b79d2f9b74ecbdc8b095749237f277007f9.tar.xz
re3-2d986b79d2f9b74ecbdc8b095749237f277007f9.tar.zst
re3-2d986b79d2f9b74ecbdc8b095749237f277007f9.zip
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua49
1 files changed, 31 insertions, 18 deletions
diff --git a/premake5.lua b/premake5.lua
index 1e51112e..0d28573b 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -1,5 +1,5 @@
workspace "re3"
- configurations { "DebugCI", "ReleaseCI", "Release", "ReleaseFH", "Debug" }
+ configurations { "Debug", "Release", "ReleaseFH" }
location "build"
files { "src/*.*" }
@@ -38,6 +38,32 @@ workspace "re3"
includedirs { "rwsdk/include/d3d8" }
libdirs { "dxsdk/lib" }
+
+ pbcommands = {
+ "setlocal EnableDelayedExpansion",
+ "set file=$(TargetPath)",
+ "FOR %%i IN (\"%file%\") DO (",
+ "set filename=%%~ni",
+ "set fileextension=%%~xi",
+ "set target=!path!!filename!!fileextension!",
+ "if exist \"!target!\" copy /y \"!file!\" \"!target!\"",
+ ")" }
+
+ function setpaths (gamepath, exepath, scriptspath)
+ scriptspath = scriptspath or ""
+ if (gamepath) then
+ cmdcopy = { "set \"path=" .. gamepath .. scriptspath .. "\"" }
+ table.insert(cmdcopy, pbcommands)
+ postbuildcommands (cmdcopy)
+ debugdir (gamepath)
+ if (exepath) then
+ debugcommand (gamepath .. exepath)
+ dir, file = exepath:match'(.*/)(.*)'
+ debugdir (gamepath .. (dir or ""))
+ end
+ end
+ --targetdir ("bin/%{prj.name}/" .. scriptspath)
+ end
project "re3"
kind "SharedLib"
@@ -52,31 +78,18 @@ project "re3"
defines { "DEBUG" }
staticruntime "on"
symbols "On"
- debugdir "$(GTA_III_RE_DIR)"
- debugcommand "$(GTA_III_RE_DIR)/gta3.exe"
- postbuildcommands "copy /y \"$(TargetPath)\" \"$(GTA_III_RE_DIR)\\plugins\\re3.dll\""
+ setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
staticruntime "on"
- debugdir "C:/Users/aap/games/gta3_re"
- debugcommand "C:/Users/aap/games/gta3_re/gta3.exe"
- postbuildcommands "copy /y \"$(TargetPath)\" \"$(GTA_III_RE_DIR)\\plugins\\re3.dll\""
+ setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "plugins/")
+
filter "configurations:ReleaseFH"
defines { "NDEBUG" }
symbols "Full"
optimize "off"
staticruntime "on"
- debugdir "$(GTA_III_DIR)"
- debugcommand "$(GTA_III_DIR)/gta3.exe"
targetextension ".asi"
- targetdir "$(GTA_III_DIR)/scripts"
- filter "configurations:DebugCI"
- defines { "DEBUG" }
- symbols "On"
- staticruntime "on"
- filter "configurations:ReleaseCI"
- defines { "NDEBUG" }
- optimize "On"
- staticruntime "on"
+ setpaths("$(GTA_III_RE_DIR)/", "gta3.exe", "scripts/")