mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-23 10:52:36 +01:00
165 lines
3.4 KiB
Lua
165 lines
3.4 KiB
Lua
-- premake5.lua
|
|
|
|
require "premake_modules/psx"
|
|
|
|
-- you can redefine dependencies
|
|
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"
|
|
|
|
PSYQ_DIR = os.getenv("PSYQ_DIR") or "PSY-Q"
|
|
|
|
GAME_REGION = os.getenv("GAME_REGION") or "NTSC_VERSION" -- or PAL_VERSION
|
|
|
|
if not (GAME_REGION == "NTSC_VERSION" or GAME_REGION == "PAL_VERSION") then
|
|
error("'GAME_REGION' should be 'NTSC_VERSION' or 'PAL_VERSION'")
|
|
end
|
|
|
|
workspace "REDRIVER2"
|
|
configurations { "Debug", "Release", "Release Dev" }
|
|
|
|
defines { VERSION }
|
|
|
|
filter "system:Windows or linux"
|
|
defines { "USE_32_BIT_ADDR", "PGXP" }
|
|
|
|
filter "configurations:Debug"
|
|
defines {
|
|
"DEBUG",
|
|
}
|
|
symbols "On"
|
|
|
|
filter "configurations:Release"
|
|
defines {
|
|
"NDEBUG",
|
|
}
|
|
|
|
if os.target() == "windows" then
|
|
dofile("premake_libjpeg.lua")
|
|
end
|
|
|
|
if os.target() ~= "psx" then
|
|
dofile("premake_emulator.lua")
|
|
end
|
|
|
|
-- TODO: overlays
|
|
|
|
-- game iteslf
|
|
project "REDRIVER2"
|
|
kind "ConsoleApp"
|
|
language "C++"
|
|
compileas "C++"
|
|
targetdir "bin/%{cfg.buildcfg}"
|
|
|
|
includedirs {
|
|
"GAME",
|
|
}
|
|
|
|
defines { GAME_REGION }
|
|
|
|
files {
|
|
"GAME/**.H",
|
|
"GAME/**.C",
|
|
}
|
|
|
|
-- 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
|
|
|
|
filter "system:Windows or linux"
|
|
defines { "OGL", "GLEW", "SIMPLE_SPOOL" }
|
|
dependson { "PSX" }
|
|
links { "PSX", "jpeg" }
|
|
|
|
includedirs {
|
|
"EMULATOR"
|
|
}
|
|
|
|
files {
|
|
"utils/**.h",
|
|
"utils/**.cpp",
|
|
"redriver2_psxpc.cpp",
|
|
"DebugOverlay.cpp",
|
|
}
|
|
|
|
filter "system:Windows"
|
|
|
|
files {
|
|
"Windows/resource.h",
|
|
"Windows/Resource.rc",
|
|
"Windows/main.ico"
|
|
}
|
|
|
|
includedirs {
|
|
SDL2_DIR.."/include",
|
|
GLEW_DIR.."/include",
|
|
OPENAL_DIR.."/include",
|
|
JPEG_DIR.."/",
|
|
}
|
|
|
|
linkoptions {
|
|
"/SAFESEH:NO", -- Image Has Safe Exception Handers: No. Because of openal-soft
|
|
}
|
|
|
|
filter "system:linux"
|
|
buildoptions { "-Wno-narrowing", "-fpermissive" }
|
|
cppdialect "C++11"
|
|
|
|
includedirs {
|
|
"/usr/include/SDL2"
|
|
}
|
|
|
|
links {
|
|
"GL",
|
|
"GLEW",
|
|
"openal",
|
|
"SDL2",
|
|
}
|
|
|
|
linkoptions { "-z muldefs" }
|
|
|
|
filter "system:psx"
|
|
defines { "PSX" }
|
|
includedirs {
|
|
PSYQ_DIR.."/include"
|
|
}
|
|
links {
|
|
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"
|
|
}
|
|
|
|
filter "configurations:Debug"
|
|
targetsuffix "_dbg"
|
|
defines {
|
|
"DEBUG_OPTIONS",
|
|
"COLLISION_DEBUG",
|
|
"CUTSCENE_RECORDER"
|
|
}
|
|
symbols "On"
|
|
|
|
filter "configurations:Release"
|
|
optimize "Full"
|
|
|
|
filter "configurations:Release Dev"
|
|
targetsuffix "_dev"
|
|
defines {
|
|
"DEBUG_OPTIONS",
|
|
"COLLISION_DEBUG",
|
|
"CUTSCENE_RECORDER"
|
|
}
|
|
optimize "Full" |