2020-07-24 17:38:25 +02:00
|
|
|
-- premake5.lua
|
|
|
|
|
2020-07-24 18:15:59 +02:00
|
|
|
-- you can redefine dependencies
|
|
|
|
local SDL2_DIR = os.getenv("SDL2_DIR") or "dependencies/SDL2"
|
|
|
|
local GLEW_DIR = os.getenv("GLEW_DIR") or "dependencies/glew"
|
|
|
|
local OPENAL_DIR = os.getenv("OPENAL_DIR") or "dependencies/openal-soft"
|
2020-07-24 18:51:09 +02:00
|
|
|
local GAME_REGION = os.getenv("GAME_REGION") or "NTSC_VERSION" -- or PAL_VERSION
|
2020-07-24 18:15:59 +02:00
|
|
|
|
2020-07-24 18:51:09 +02:00
|
|
|
if not (GAME_REGION == "NTSC_VERSION" or GAME_REGION == "PAL_VERSION") then
|
|
|
|
error("'GAME_REGION' should be 'NTSC_VERSION' or 'PAL_VERSION'")
|
2020-07-24 18:15:59 +02:00
|
|
|
end
|
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
workspace "REDRIVER2"
|
|
|
|
configurations { "Debug", "Release" }
|
|
|
|
|
2020-07-24 18:15:59 +02:00
|
|
|
defines { VERSION }
|
2020-07-24 17:38:25 +02:00
|
|
|
|
|
|
|
filter "system:Windows"
|
|
|
|
defines { "USE_32_BIT_ADDR", "PGXP" }
|
|
|
|
|
2020-08-10 09:32:01 +02:00
|
|
|
filter "configurations:Debug"
|
|
|
|
defines {
|
|
|
|
"DEBUG",
|
|
|
|
}
|
|
|
|
symbols "On"
|
|
|
|
|
|
|
|
filter "configurations:Release"
|
|
|
|
defines {
|
|
|
|
"NDEBUG",
|
|
|
|
}
|
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
-- EMULATOR layer
|
|
|
|
project "PSX"
|
|
|
|
kind "StaticLib"
|
|
|
|
language "C++"
|
|
|
|
compileas "C++"
|
|
|
|
targetdir "bin/%{cfg.buildcfg}"
|
|
|
|
|
|
|
|
includedirs {
|
|
|
|
".",
|
|
|
|
"EMULATOR"
|
|
|
|
}
|
|
|
|
|
2020-07-24 19:44:42 +02:00
|
|
|
defines { GAME_REGION }
|
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
files {
|
|
|
|
"EMULATOR/**.h",
|
|
|
|
"EMULATOR/**.c",
|
|
|
|
"EMULATOR/**.cpp",
|
|
|
|
}
|
|
|
|
|
|
|
|
defines { "OGL", "GLEW" }
|
|
|
|
|
|
|
|
includedirs {
|
2020-07-24 18:15:59 +02:00
|
|
|
SDL2_DIR.."/include",
|
|
|
|
GLEW_DIR.."/include",
|
|
|
|
OPENAL_DIR.."/include",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
filter "system:Windows"
|
|
|
|
links {
|
|
|
|
"opengl32",
|
|
|
|
"glew32",
|
|
|
|
"SDL2",
|
|
|
|
"OpenAL32"
|
|
|
|
}
|
|
|
|
|
|
|
|
libdirs {
|
2020-07-24 18:15:59 +02:00
|
|
|
SDL2_DIR.."/lib/x86",
|
|
|
|
GLEW_DIR.."/lib/Release/Win32",
|
|
|
|
OPENAL_DIR.."/libs/Win32",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
|
|
|
|
2020-08-10 09:32:01 +02:00
|
|
|
filter "configurations:Release"
|
|
|
|
optimize "Full"
|
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
-- game iteslf
|
|
|
|
project "REDRIVER2"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
language "C++"
|
|
|
|
compileas "C++"
|
|
|
|
targetdir "bin/%{cfg.buildcfg}"
|
|
|
|
|
|
|
|
includedirs {
|
|
|
|
".",
|
|
|
|
"EMULATOR"
|
|
|
|
}
|
|
|
|
|
2020-07-24 18:51:09 +02:00
|
|
|
defines { GAME_REGION }
|
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
files {
|
|
|
|
"GAME/**.h",
|
|
|
|
"GAME/**.c",
|
|
|
|
"redriver2_psxpc.c",
|
|
|
|
"DebugOverlay.cpp",
|
|
|
|
--"THISDUST.C",
|
|
|
|
"THISDUST.H",
|
|
|
|
}
|
|
|
|
|
|
|
|
filter "system:Windows"
|
|
|
|
dependson { "PSX" }
|
|
|
|
files {
|
|
|
|
"Windows/resource.h",
|
|
|
|
"Windows/Resource.rc",
|
|
|
|
"Windows/main.ico"
|
|
|
|
}
|
|
|
|
|
|
|
|
defines { "OGL", "GLEW" }
|
|
|
|
|
|
|
|
includedirs {
|
2020-07-24 18:15:59 +02:00
|
|
|
SDL2_DIR.."/include",
|
|
|
|
GLEW_DIR.."/include",
|
|
|
|
OPENAL_DIR.."/include",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
links { "PSX" } -- only need to link emulator
|
|
|
|
|
|
|
|
linkoptions {
|
|
|
|
"/SAFESEH:NO", -- Image Has Safe Exception Handers: No. Because of openal-soft
|
|
|
|
}
|
|
|
|
|
|
|
|
filter "configurations:Debug"
|
|
|
|
defines {
|
|
|
|
"DEBUG_OPTIONS",
|
|
|
|
"COLLISION_DEBUG"
|
|
|
|
}
|
|
|
|
|
|
|
|
filter "configurations:Release"
|
|
|
|
defines {
|
|
|
|
"DEBUG_OPTIONS",
|
|
|
|
--"COLLISION_DEBUG"
|
|
|
|
}
|
2020-08-10 09:32:01 +02:00
|
|
|
optimize "Size" -- code optimizations are disabled due to calculation differences for replays
|