2020-07-24 17:38:25 +02:00
|
|
|
-- premake5.lua
|
|
|
|
|
2020-10-01 19:15:33 +02:00
|
|
|
require "premake_modules/psx"
|
|
|
|
|
2020-07-24 18:15:59 +02:00
|
|
|
-- you can redefine dependencies
|
2020-09-20 20:21:36 +02:00
|
|
|
SDL2_DIR = os.getenv("SDL2_DIR") or "dependencies/SDL2"
|
|
|
|
GLEW_DIR = os.getenv("GLEW_DIR") or "dependencies/glew"
|
|
|
|
OPENAL_DIR = os.getenv("OPENAL_DIR") or "dependencies/openal-soft"
|
|
|
|
JPEG_DIR = os.getenv("JPEG_DIR") or "dependencies/jpeg"
|
|
|
|
|
2020-10-01 19:15:33 +02:00
|
|
|
PSYQ_DIR = os.getenv("PSYQ_DIR") or "PSY-Q"
|
|
|
|
|
2020-09-20 20:21:36 +02:00
|
|
|
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-10-01 19:15:33 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
workspace "REDRIVER2"
|
2020-10-01 19:15:33 +02:00
|
|
|
configurations { "Debug", "Release", "Release Dev" }
|
2020-07-24 17:38:25 +02:00
|
|
|
|
2020-07-24 18:15:59 +02:00
|
|
|
defines { VERSION }
|
2020-09-30 05:55:53 +02:00
|
|
|
|
|
|
|
filter "system:Windows or linux"
|
|
|
|
defines { "USE_32_BIT_ADDR", "PGXP" }
|
2020-07-24 17:38:25 +02:00
|
|
|
|
2020-08-10 09:32:01 +02:00
|
|
|
filter "configurations:Debug"
|
|
|
|
defines {
|
|
|
|
"DEBUG",
|
|
|
|
}
|
|
|
|
symbols "On"
|
|
|
|
|
|
|
|
filter "configurations:Release"
|
|
|
|
defines {
|
|
|
|
"NDEBUG",
|
|
|
|
}
|
2020-09-27 00:44:27 +02:00
|
|
|
|
2020-10-01 19:15:33 +02:00
|
|
|
if os.target() == "windows" then
|
|
|
|
dofile("premake_libjpeg.lua")
|
|
|
|
end
|
|
|
|
|
|
|
|
if os.target() ~= "psx" then
|
|
|
|
dofile("premake_emulator.lua")
|
|
|
|
end
|
|
|
|
|
|
|
|
-- TODO: overlays
|
2020-08-10 09:32:01 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
-- game iteslf
|
|
|
|
project "REDRIVER2"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
language "C++"
|
|
|
|
compileas "C++"
|
|
|
|
targetdir "bin/%{cfg.buildcfg}"
|
|
|
|
|
|
|
|
includedirs {
|
2020-09-05 20:17:44 +02:00
|
|
|
"GAME",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
|
|
|
|
2020-07-24 18:51:09 +02:00
|
|
|
defines { GAME_REGION }
|
|
|
|
|
2020-09-27 00:44:27 +02:00
|
|
|
files {
|
|
|
|
"GAME/**.H",
|
|
|
|
"GAME/**.C",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
2020-10-01 19:15:33 +02:00
|
|
|
|
|
|
|
-- exclude sources which belong to overlays
|
|
|
|
if os.target() == "psx" then
|
|
|
|
excludes {
|
|
|
|
"GAME/MEMCARD/**.C",
|
|
|
|
"GAME/MEMCARD/**.H",
|
|
|
|
"GAME/FRONTEND/**.C",
|
|
|
|
"GAME/FRONTEND/**.H",
|
|
|
|
"GAME/C/LEADAI.C",
|
|
|
|
"GAME/C/PATHFIND.C",
|
|
|
|
}
|
|
|
|
end
|
2020-07-24 17:38:25 +02:00
|
|
|
|
2020-09-30 05:55:53 +02:00
|
|
|
filter "system:Windows or linux"
|
2020-10-01 19:15:33 +02:00
|
|
|
defines { "OGL", "GLEW", "SIMPLE_SPOOL" }
|
2020-09-30 05:55:53 +02:00
|
|
|
dependson { "PSX" }
|
|
|
|
links { "PSX", "jpeg" }
|
2020-09-30 07:09:06 +02:00
|
|
|
|
|
|
|
includedirs {
|
|
|
|
"EMULATOR"
|
|
|
|
}
|
|
|
|
|
|
|
|
files {
|
|
|
|
"utils/**.h",
|
|
|
|
"utils/**.cpp",
|
|
|
|
"redriver2_psxpc.cpp",
|
|
|
|
"DebugOverlay.cpp",
|
|
|
|
}
|
2020-09-27 00:44:27 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
filter "system:Windows"
|
2020-10-01 19:15:33 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
files {
|
|
|
|
"Windows/resource.h",
|
|
|
|
"Windows/Resource.rc",
|
|
|
|
"Windows/main.ico"
|
|
|
|
}
|
|
|
|
|
|
|
|
includedirs {
|
2020-07-24 18:15:59 +02:00
|
|
|
SDL2_DIR.."/include",
|
|
|
|
GLEW_DIR.."/include",
|
|
|
|
OPENAL_DIR.."/include",
|
2020-09-20 20:21:36 +02:00
|
|
|
JPEG_DIR.."/",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
linkoptions {
|
|
|
|
"/SAFESEH:NO", -- Image Has Safe Exception Handers: No. Because of openal-soft
|
2020-09-27 00:44:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
filter "system:linux"
|
2020-10-08 04:42:37 +02:00
|
|
|
buildoptions {
|
|
|
|
"-Wno-narrowing",
|
|
|
|
"-fpermissive",
|
|
|
|
"-m32"
|
|
|
|
}
|
|
|
|
|
2020-09-27 00:44:27 +02:00
|
|
|
cppdialect "C++11"
|
|
|
|
|
2020-09-30 05:55:53 +02:00
|
|
|
includedirs {
|
|
|
|
"/usr/include/SDL2"
|
|
|
|
}
|
|
|
|
|
2020-09-27 00:44:27 +02:00
|
|
|
links {
|
|
|
|
"GL",
|
|
|
|
"GLEW",
|
|
|
|
"openal",
|
|
|
|
"SDL2",
|
|
|
|
}
|
|
|
|
|
2020-10-08 04:42:37 +02:00
|
|
|
linkoptions {
|
|
|
|
"-z muldefs",
|
|
|
|
"-m32"
|
|
|
|
}
|
2020-10-01 19:15:33 +02:00
|
|
|
|
|
|
|
filter "system:psx"
|
|
|
|
defines { "PSX" }
|
|
|
|
includedirs {
|
|
|
|
PSYQ_DIR.."/include"
|
|
|
|
}
|
|
|
|
links {
|
2020-10-05 20:42:09 +02:00
|
|
|
PSYQ_DIR.."/lib/LIBETC",
|
|
|
|
PSYQ_DIR.."/lib/LIBPAD",
|
|
|
|
PSYQ_DIR.."/lib/LIBGTE",
|
|
|
|
PSYQ_DIR.."/lib/LIBMCRD",
|
|
|
|
PSYQ_DIR.."/lib/LIBCD",
|
|
|
|
PSYQ_DIR.."/lib/LIBSN",
|
|
|
|
PSYQ_DIR.."/lib/LIBSPU",
|
|
|
|
PSYQ_DIR.."/lib/LIBAPI"
|
2020-10-01 19:15:33 +02:00
|
|
|
}
|
2020-07-24 17:38:25 +02:00
|
|
|
|
|
|
|
filter "configurations:Debug"
|
2020-10-05 20:42:09 +02:00
|
|
|
targetsuffix "_dbg"
|
2020-07-24 17:38:25 +02:00
|
|
|
defines {
|
|
|
|
"DEBUG_OPTIONS",
|
2020-10-05 20:42:09 +02:00
|
|
|
"COLLISION_DEBUG",
|
|
|
|
"CUTSCENE_RECORDER"
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
2020-10-01 19:15:33 +02:00
|
|
|
symbols "On"
|
2020-07-24 17:38:25 +02:00
|
|
|
|
|
|
|
filter "configurations:Release"
|
2020-10-01 19:15:33 +02:00
|
|
|
optimize "Full"
|
|
|
|
|
|
|
|
filter "configurations:Release Dev"
|
2020-10-05 20:42:09 +02:00
|
|
|
targetsuffix "_dev"
|
2020-07-24 17:38:25 +02:00
|
|
|
defines {
|
2020-10-01 19:15:33 +02:00
|
|
|
"DEBUG_OPTIONS",
|
2020-10-05 20:42:09 +02:00
|
|
|
"COLLISION_DEBUG",
|
|
|
|
"CUTSCENE_RECORDER"
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
2020-09-05 11:10:57 +02:00
|
|
|
optimize "Full"
|