2020-07-24 17:38:25 +02:00
|
|
|
-- premake5.lua
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
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-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-09-30 05:55:53 +02:00
|
|
|
if _TARGET_OS == "windows" then
|
2020-09-27 00:44:27 +02:00
|
|
|
dofile("premake_libjpeg.lua")
|
|
|
|
end
|
2020-08-10 09:32:01 +02:00
|
|
|
|
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-09-27 00:44:27 +02:00
|
|
|
files {
|
2020-07-24 17:38:25 +02:00
|
|
|
"EMULATOR/**.h",
|
2020-09-27 00:44:27 +02:00
|
|
|
"EMULATOR/**.H",
|
2020-07-24 17:38:25 +02:00
|
|
|
"EMULATOR/**.c",
|
2020-09-27 00:44:27 +02:00
|
|
|
"EMULATOR/**.C",
|
2020-07-24 17:38:25 +02:00
|
|
|
"EMULATOR/**.cpp",
|
2020-09-27 00:44:27 +02:00
|
|
|
"EMULATOR/**.CPP",
|
2020-07-24 17:38:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
defines { "OGL", "GLEW" }
|
|
|
|
|
2020-09-30 05:55:53 +02:00
|
|
|
includedirs {
|
|
|
|
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-09-27 00:44:27 +02:00
|
|
|
filter "system:linux"
|
2020-10-03 04:41:12 +02:00
|
|
|
buildoptions { "-Wno-narrowing", "-m32" }
|
2020-09-27 00:44:27 +02:00
|
|
|
|
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-03 04:41:12 +02:00
|
|
|
linkoptions { "-m32" }
|
|
|
|
|
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 {
|
2020-09-05 20:17:44 +02:00
|
|
|
"GAME",
|
2020-07-24 17:38:25 +02:00
|
|
|
"EMULATOR"
|
|
|
|
}
|
|
|
|
|
2020-07-24 18:51:09 +02:00
|
|
|
defines { GAME_REGION }
|
|
|
|
|
2020-09-27 00:44:27 +02:00
|
|
|
files {
|
|
|
|
"GAME/**.H",
|
|
|
|
"GAME/**.C",
|
|
|
|
"utils/**.h",
|
|
|
|
"utils/**.cpp",
|
|
|
|
"redriver2_psxpc.cpp",
|
2020-07-24 17:38:25 +02:00
|
|
|
"DebugOverlay.cpp",
|
|
|
|
}
|
|
|
|
|
2020-09-30 05:55:53 +02:00
|
|
|
filter "system:Windows or linux"
|
|
|
|
defines { "OGL", "GLEW" }
|
|
|
|
dependson { "PSX" }
|
|
|
|
links { "PSX", "jpeg" }
|
2020-09-27 00:44:27 +02:00
|
|
|
|
2020-07-24 17:38:25 +02:00
|
|
|
filter "system:Windows"
|
|
|
|
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-03 04:41:12 +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-03 04:41:12 +02:00
|
|
|
linkoptions { "-z muldefs", "-m32" }
|
2020-07-24 17:38:25 +02:00
|
|
|
|
|
|
|
filter "configurations:Debug"
|
|
|
|
defines {
|
|
|
|
"DEBUG_OPTIONS",
|
|
|
|
"COLLISION_DEBUG"
|
|
|
|
}
|
|
|
|
|
|
|
|
filter "configurations:Release"
|
|
|
|
defines {
|
2020-09-05 20:17:44 +02:00
|
|
|
--"DEBUG_OPTIONS",
|
2020-07-24 17:38:25 +02:00
|
|
|
--"COLLISION_DEBUG"
|
|
|
|
}
|
2020-09-05 11:10:57 +02:00
|
|
|
optimize "Full"
|