REDRIVER2/src_rebuild/premake5.lua

191 lines
3.8 KiB
Lua
Raw Normal View History

-- premake5.lua
require "premake_modules/psx"
2020-07-24 18:15:59 +02:00
-- you can redefine dependencies
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"
PSYQ_DIR = os.getenv("PSYQ_DIR") or "PSY-Q"
GAME_REGION = os.getenv("GAME_REGION") or "NTSC_VERSION" -- or PAL_VERSION
2020-07-24 18:15:59 +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
workspace "REDRIVER2"
configurations { "Debug", "Release", "Release_dev" }
2020-12-10 22:06:44 +01:00
platforms { "x86" } --, "x86_64" }
2020-07-24 18:15:59 +02:00
defines { VERSION }
filter "system:Linux"
buildoptions {
"-Wno-narrowing",
"-Wno-endif-labels",
"-Wno-write-strings",
"-Wno-format-security",
"-Wno-unused-result",
"-fpermissive"
}
cppdialect "C++11"
2020-12-10 22:06:44 +01:00
filter {"system:Linux", "platforms:x86"}
buildoptions {
"-m32"
}
linkoptions {
"-m32"
}
filter "system:Windows"
disablewarnings { "4996", "4554", "4244", "4101", "4838", "4309" }
filter "configurations:Debug"
defines {
"_DEBUG",
"DEBUG"
}
symbols "On"
filter "configurations:Release"
defines {
"NDEBUG",
}
filter "configurations:Release_dev"
defines {
"NDEBUG",
}
if os.target() == "windows" then
dofile("premake_libjpeg.lua")
end
if os.target() ~= "psx" then
dofile("PsyX/premake5.lua")
end
-- TODO: overlays
-- game iteslf
project "REDRIVER2"
kind "WindowedApp"
language "c++"
targetdir "bin/%{cfg.buildcfg}"
includedirs {
2020-12-28 11:28:40 +01:00
"Game",
}
defines { GAME_REGION }
files {
2020-12-28 11:28:40 +01:00
"Game/**.h",
"Game/**.c"
}
-- 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",
}
end
filter "system:Windows or linux"
defines { "SIMPLE_SPOOL" }
dependson { "PsyX" }
links { "Psy-X", "jpeg" }
includedirs {
"PsyX/include"
}
files {
"utils/**.h",
"utils/**.cpp",
"utils/**.c",
"redriver2_psxpc.cpp",
"DebugOverlay.cpp",
}
filter "system:Windows"
entrypoint "mainCRTStartup"
files {
"Windows/resource.h",
"Windows/Resource.rc",
"Windows/main.ico"
}
includedirs {
2020-07-24 18:15:59 +02:00
SDL2_DIR.."/include",
OPENAL_DIR.."/include",
JPEG_DIR.."/",
}
linkoptions {
"/SAFESEH:NO", -- Image Has Safe Exception Handers: No. Because of openal-soft
}
filter "system:linux"
includedirs {
"/usr/include/SDL2"
}
links {
"GL",
"openal",
"SDL2",
2020-11-19 16:27:50 +01:00
"dl",
}
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"
2020-12-20 11:40:16 +01:00
optimize "Speed"
filter "configurations:Release_dev"
targetsuffix "_dev"
defines {
"DEBUG_OPTIONS",
"COLLISION_DEBUG",
"CUTSCENE_RECORDER"
}
optimize "Speed"
filter { "files:**.c", "files:**.C" }
compileas "C++"