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"
|
|
|
|
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
|
2021-04-29 22:37:51 +02:00
|
|
|
|
|
|
|
------------------------------------------
|
|
|
|
|
|
|
|
newoption {
|
|
|
|
trigger = "raspberry-pi",
|
|
|
|
description = "adds specific define for compiling on Raspberry Pi"
|
|
|
|
}
|
|
|
|
|
|
|
|
------------------------------------------
|
2020-10-01 19:15:33 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
workspace "REDRIVER2"
|
2020-11-20 18:26:28 +01:00
|
|
|
configurations { "Debug", "Release", "Release_dev" }
|
2020-12-10 22:06:44 +01:00
|
|
|
platforms { "x86" } --, "x86_64" }
|
2020-07-24 17:38:25 +02:00
|
|
|
|
2020-07-24 18:15:59 +02:00
|
|
|
defines { VERSION }
|
2021-04-29 22:37:51 +02:00
|
|
|
|
|
|
|
configuration "raspberry-pi"
|
|
|
|
defines { "__RPI__" }
|
2020-09-30 05:55:53 +02:00
|
|
|
|
2020-12-10 07:33:28 +01:00
|
|
|
filter "system:Linux"
|
|
|
|
buildoptions {
|
|
|
|
"-Wno-narrowing",
|
|
|
|
"-Wno-endif-labels",
|
|
|
|
"-Wno-write-strings",
|
|
|
|
"-Wno-format-security",
|
|
|
|
"-Wno-unused-result",
|
2020-12-10 21:47:59 +01:00
|
|
|
"-fpermissive"
|
2020-12-10 07:33:28 +01:00
|
|
|
}
|
2020-12-10 21:47:59 +01:00
|
|
|
|
2020-12-10 07:33:28 +01:00
|
|
|
cppdialect "C++11"
|
2020-12-10 21:47:59 +01:00
|
|
|
|
2020-12-10 22:06:44 +01:00
|
|
|
filter {"system:Linux", "platforms:x86"}
|
|
|
|
buildoptions {
|
|
|
|
"-m32"
|
|
|
|
}
|
|
|
|
|
|
|
|
linkoptions {
|
|
|
|
"-m32"
|
|
|
|
}
|
2020-12-10 07:33:28 +01:00
|
|
|
|
2020-11-20 16:59:46 +01:00
|
|
|
filter "system:Windows"
|
|
|
|
disablewarnings { "4996", "4554", "4244", "4101", "4838", "4309" }
|
|
|
|
|
2020-08-10 09:32:01 +02:00
|
|
|
filter "configurations:Debug"
|
|
|
|
defines {
|
2020-12-21 18:10:29 +01:00
|
|
|
"_DEBUG",
|
|
|
|
"DEBUG"
|
2020-08-10 09:32:01 +02:00
|
|
|
}
|
|
|
|
symbols "On"
|
|
|
|
|
|
|
|
filter "configurations:Release"
|
|
|
|
defines {
|
|
|
|
"NDEBUG",
|
|
|
|
}
|
2020-10-24 20:52:13 +02:00
|
|
|
|
2020-11-20 18:26:28 +01:00
|
|
|
filter "configurations:Release_dev"
|
2020-10-24 20:52:13 +02:00
|
|
|
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
|
2020-11-18 20:14:45 +01:00
|
|
|
dofile("PsyX/premake5.lua")
|
2020-10-01 19:15:33 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- TODO: overlays
|
2020-08-10 09:32:01 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
-- game iteslf
|
|
|
|
project "REDRIVER2"
|
2021-02-14 20:05:50 +01:00
|
|
|
kind "WindowedApp"
|
|
|
|
|
2020-12-28 15:27:00 +01:00
|
|
|
language "c++"
|
2020-07-24 17:38:25 +02:00
|
|
|
targetdir "bin/%{cfg.buildcfg}"
|
|
|
|
|
|
|
|
includedirs {
|
2020-12-28 11:28:40 +01: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 {
|
2020-12-28 11:28:40 +01:00
|
|
|
"Game/**.h",
|
2020-12-28 15:27:00 +01:00
|
|
|
"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 {
|
2020-12-28 11:28:40 +01:00
|
|
|
"Game/MemCard/**.c",
|
|
|
|
"Game/MemCard/**.h",
|
|
|
|
"Game/Frontend/**.c",
|
|
|
|
"Game/Frontend/**.h",
|
|
|
|
"Game/C/leadai.c",
|
2020-12-28 12:41:54 +01:00
|
|
|
"Game/C/pathfind.c",
|
2020-10-01 19:15:33 +02:00
|
|
|
}
|
2020-12-28 15:27:00 +01:00
|
|
|
end
|
2020-07-24 17:38:25 +02:00
|
|
|
|
2020-09-30 05:55:53 +02:00
|
|
|
filter "system:Windows or linux"
|
2020-12-10 21:47:59 +01:00
|
|
|
defines { "SIMPLE_SPOOL" }
|
2020-11-18 20:14:45 +01:00
|
|
|
dependson { "PsyX" }
|
|
|
|
links { "Psy-X", "jpeg" }
|
2020-09-30 07:09:06 +02:00
|
|
|
|
|
|
|
includedirs {
|
2020-12-24 17:44:40 +01:00
|
|
|
"PsyX/include"
|
2020-09-30 07:09:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
files {
|
|
|
|
"utils/**.h",
|
|
|
|
"utils/**.cpp",
|
2020-10-21 07:43:29 +02:00
|
|
|
"utils/**.c",
|
2020-09-30 07:09:06 +02:00
|
|
|
"redriver2_psxpc.cpp",
|
|
|
|
"DebugOverlay.cpp",
|
|
|
|
}
|
2020-09-27 00:44:27 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
filter "system:Windows"
|
2021-02-14 20:05:50 +01:00
|
|
|
entrypoint "mainCRTStartup"
|
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
files {
|
|
|
|
"Windows/resource.h",
|
|
|
|
"Windows/Resource.rc",
|
|
|
|
"Windows/main.ico"
|
|
|
|
}
|
2021-02-14 20:05:50 +01:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
includedirs {
|
2020-07-24 18:15:59 +02:00
|
|
|
SDL2_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-09-30 05:55:53 +02:00
|
|
|
includedirs {
|
|
|
|
"/usr/include/SDL2"
|
|
|
|
}
|
|
|
|
|
2020-09-27 00:44:27 +02:00
|
|
|
links {
|
|
|
|
"GL",
|
|
|
|
"openal",
|
|
|
|
"SDL2",
|
2020-11-19 16:27:50 +01:00
|
|
|
"dl",
|
2020-09-27 00:44:27 +02:00
|
|
|
}
|
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-12-20 11:40:16 +01:00
|
|
|
optimize "Speed"
|
2020-10-01 19:15:33 +02:00
|
|
|
|
2020-11-20 18:26:28 +01:00
|
|
|
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-12-21 18:10:29 +01:00
|
|
|
optimize "Speed"
|
2020-12-28 15:27:00 +01:00
|
|
|
|
|
|
|
filter { "files:**.c", "files:**.C" }
|
|
|
|
compileas "C++"
|