2018-08-08 18:55:45 +01:00
|
|
|
newoption {
|
|
|
|
trigger = "gfxlib",
|
|
|
|
value = "LIBRARY",
|
|
|
|
description = "Choose a particular development library",
|
|
|
|
default = "glfw",
|
|
|
|
allowed = {
|
|
|
|
{ "glfw", "GLFW" },
|
|
|
|
{ "sdl2", "SDL2" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2018-07-25 19:42:03 +01:00
|
|
|
newoption {
|
2020-04-28 16:24:26 +01:00
|
|
|
trigger = "glfwdir64",
|
2018-08-08 18:55:45 +01:00
|
|
|
value = "PATH",
|
2018-07-25 19:42:03 +01:00
|
|
|
description = "Directory of glfw",
|
2021-07-09 18:54:22 +01:00
|
|
|
default = "../glfw-3.3.4.bin.WIN64",
|
2020-04-16 16:46:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
|
|
|
trigger = "glfwdir32",
|
|
|
|
value = "PATH",
|
|
|
|
description = "Directory of glfw",
|
2021-07-09 18:54:22 +01:00
|
|
|
default = "../glfw-3.3.4.bin.WIN32",
|
2018-07-25 19:42:03 +01:00
|
|
|
}
|
2017-08-09 09:57:32 +01:00
|
|
|
|
2018-08-08 18:55:45 +01:00
|
|
|
newoption {
|
|
|
|
trigger = "sdl2dir",
|
|
|
|
value = "PATH",
|
|
|
|
description = "Directory of sdl2",
|
2021-07-09 18:54:22 +01:00
|
|
|
default = "../SDL2-2.0.14",
|
2018-08-08 18:55:45 +01:00
|
|
|
}
|
|
|
|
|
2017-07-27 11:34:06 +01:00
|
|
|
workspace "librw"
|
|
|
|
location "build"
|
|
|
|
language "C++"
|
|
|
|
|
|
|
|
configurations { "Release", "Debug" }
|
|
|
|
filter { "system:windows" }
|
|
|
|
configurations { "ReleaseStatic" }
|
|
|
|
platforms { "win-x86-null", "win-x86-gl3", "win-x86-d3d9",
|
|
|
|
"win-amd64-null", "win-amd64-gl3", "win-amd64-d3d9" }
|
|
|
|
filter { "system:linux" }
|
|
|
|
platforms { "linux-x86-null", "linux-x86-gl3",
|
2017-08-12 09:25:25 +01:00
|
|
|
"linux-amd64-null", "linux-amd64-gl3",
|
2020-05-12 20:31:44 +01:00
|
|
|
"linux-arm-null", "linux-arm-gl3",
|
2017-08-12 09:25:25 +01:00
|
|
|
"ps2" }
|
2018-08-08 18:55:45 +01:00
|
|
|
if _OPTIONS["gfxlib"] == "sdl2" then
|
|
|
|
includedirs { "/usr/include/SDL2" }
|
|
|
|
end
|
2017-07-27 11:34:06 +01:00
|
|
|
filter {}
|
|
|
|
|
|
|
|
filter "configurations:Debug"
|
|
|
|
defines { "DEBUG" }
|
|
|
|
symbols "On"
|
|
|
|
filter "configurations:Release*"
|
|
|
|
defines { "NDEBUG" }
|
|
|
|
optimize "On"
|
|
|
|
filter "configurations:ReleaseStatic"
|
2021-07-09 18:58:23 +01:00
|
|
|
staticruntime("On")
|
2017-07-27 11:34:06 +01:00
|
|
|
|
|
|
|
filter { "platforms:*null" }
|
|
|
|
defines { "RW_NULL" }
|
|
|
|
filter { "platforms:*gl3" }
|
|
|
|
defines { "RW_GL3" }
|
2018-08-08 18:55:45 +01:00
|
|
|
if _OPTIONS["gfxlib"] == "sdl2" then
|
|
|
|
defines { "LIBRW_SDL2" }
|
|
|
|
end
|
2017-07-27 11:34:06 +01:00
|
|
|
filter { "platforms:*d3d9" }
|
|
|
|
defines { "RW_D3D9" }
|
2017-08-12 09:25:25 +01:00
|
|
|
filter { "platforms:ps2" }
|
2017-07-27 11:34:06 +01:00
|
|
|
defines { "RW_PS2" }
|
2017-08-12 09:25:25 +01:00
|
|
|
toolset "gcc"
|
|
|
|
gccprefix 'ee-'
|
|
|
|
buildoptions { "-nostdlib", "-fno-common" }
|
|
|
|
includedirs { "$(PS2SDK)/ee/include", "$(PS2SDK)/common/include" }
|
2018-07-25 19:42:03 +01:00
|
|
|
optimize "Off"
|
2017-07-27 11:34:06 +01:00
|
|
|
|
|
|
|
filter { "platforms:*amd64*" }
|
|
|
|
architecture "x86_64"
|
|
|
|
filter { "platforms:*x86*" }
|
|
|
|
architecture "x86"
|
2020-05-12 20:31:44 +01:00
|
|
|
filter { "platforms:*arm*" }
|
|
|
|
architecture "ARM"
|
2017-07-27 11:34:06 +01:00
|
|
|
|
|
|
|
filter { "platforms:win*" }
|
|
|
|
system "windows"
|
|
|
|
filter { "platforms:linux*" }
|
|
|
|
system "linux"
|
2017-07-27 14:05:30 +01:00
|
|
|
|
2017-08-09 09:57:32 +01:00
|
|
|
filter { "platforms:win*gl3" }
|
2018-08-08 18:55:45 +01:00
|
|
|
includedirs { path.join(_OPTIONS["sdl2dir"], "include") }
|
2020-04-28 16:24:26 +01:00
|
|
|
filter { "platforms:win-x86-gl3" }
|
|
|
|
includedirs { path.join(_OPTIONS["glfwdir32"], "include") }
|
|
|
|
filter { "platforms:win-amd64-gl3" }
|
|
|
|
includedirs { path.join(_OPTIONS["glfwdir64"], "include") }
|
2017-08-09 09:57:32 +01:00
|
|
|
|
2017-07-27 14:05:30 +01:00
|
|
|
filter "action:vs*"
|
2017-08-09 09:57:32 +01:00
|
|
|
buildoptions { "/wd4996", "/wd4244" }
|
2017-07-27 14:05:30 +01:00
|
|
|
|
2019-01-10 16:11:39 +00:00
|
|
|
filter { "platforms:win*gl3", "action:not vs*" }
|
|
|
|
if _OPTIONS["gfxlib"] == "sdl2" then
|
|
|
|
includedirs { "/mingw/include/SDL2" } -- TODO: Detect this properly
|
|
|
|
end
|
|
|
|
|
2017-07-27 11:34:06 +01:00
|
|
|
filter {}
|
|
|
|
|
|
|
|
Libdir = "lib/%{cfg.platform}/%{cfg.buildcfg}"
|
|
|
|
Bindir = "bin/%{cfg.platform}/%{cfg.buildcfg}"
|
|
|
|
|
|
|
|
project "librw"
|
|
|
|
kind "StaticLib"
|
|
|
|
targetname "rw"
|
|
|
|
targetdir (Libdir)
|
2020-07-28 23:23:37 +01:00
|
|
|
defines { "LODEPNG_NO_COMPILE_CPP" }
|
2017-07-27 11:34:06 +01:00
|
|
|
files { "src/*.*" }
|
|
|
|
files { "src/*/*.*" }
|
2021-01-31 12:54:41 +00:00
|
|
|
filter { "platforms:*gl3" }
|
|
|
|
files { "src/gl/glad/*.*" }
|
2017-07-27 11:34:06 +01:00
|
|
|
|
|
|
|
project "dumprwtree"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
targetdir (Bindir)
|
2017-08-24 14:10:34 +01:00
|
|
|
removeplatforms { "*gl3", "*d3d9", "ps2" }
|
2017-07-27 11:34:06 +01:00
|
|
|
files { "tools/dumprwtree/*" }
|
|
|
|
includedirs { "." }
|
|
|
|
libdirs { Libdir }
|
2017-07-27 14:05:30 +01:00
|
|
|
links { "librw" }
|
2017-08-09 23:42:33 +01:00
|
|
|
|
|
|
|
function findlibs()
|
|
|
|
filter { "platforms:linux*gl3" }
|
2021-01-31 12:48:59 +00:00
|
|
|
links { "GL" }
|
2018-08-08 18:55:45 +01:00
|
|
|
if _OPTIONS["gfxlib"] == "glfw" then
|
|
|
|
links { "glfw" }
|
|
|
|
else
|
|
|
|
links { "SDL2" }
|
|
|
|
end
|
2017-08-09 23:42:33 +01:00
|
|
|
filter { "platforms:win-amd64-gl3" }
|
2020-04-28 16:24:26 +01:00
|
|
|
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") }
|
2018-08-08 18:55:45 +01:00
|
|
|
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x64") }
|
2017-08-09 23:42:33 +01:00
|
|
|
filter { "platforms:win-x86-gl3" }
|
2020-04-16 16:46:42 +01:00
|
|
|
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-vc2015") }
|
2018-08-08 18:55:45 +01:00
|
|
|
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") }
|
2017-08-09 23:42:33 +01:00
|
|
|
filter { "platforms:win*gl3" }
|
2019-01-10 16:11:39 +00:00
|
|
|
links { "opengl32" }
|
2018-08-08 18:55:45 +01:00
|
|
|
if _OPTIONS["gfxlib"] == "glfw" then
|
|
|
|
links { "glfw3" }
|
|
|
|
else
|
|
|
|
links { "SDL2" }
|
|
|
|
end
|
2017-08-09 23:42:33 +01:00
|
|
|
filter { "platforms:*d3d9" }
|
2019-01-10 16:11:39 +00:00
|
|
|
links { "gdi32", "d3d9" }
|
|
|
|
filter { "platforms:*d3d9", "action:vs*" }
|
|
|
|
links { "Xinput9_1_0" }
|
2017-08-09 23:42:33 +01:00
|
|
|
filter {}
|
|
|
|
end
|
|
|
|
|
|
|
|
function skeleton()
|
|
|
|
files { "skeleton/*.cpp", "skeleton/*.h" }
|
2017-12-30 10:43:17 +00:00
|
|
|
files { "skeleton/imgui/*.cpp", "skeleton/imgui/*.h" }
|
2017-08-09 23:42:33 +01:00
|
|
|
includedirs { "skeleton" }
|
|
|
|
end
|
|
|
|
|
|
|
|
function skeltool(dir)
|
|
|
|
targetdir (Bindir)
|
|
|
|
files { path.join("tools", dir, "*.cpp"),
|
|
|
|
path.join("tools", dir, "*.h") }
|
|
|
|
vpaths {
|
|
|
|
{["src"] = { path.join("tools", dir, "*") }},
|
|
|
|
{["skeleton"] = { "skeleton/*" }},
|
|
|
|
}
|
|
|
|
skeleton()
|
|
|
|
debugdir ( path.join("tools", dir) )
|
|
|
|
includedirs { "." }
|
|
|
|
libdirs { Libdir }
|
|
|
|
links { "librw" }
|
|
|
|
findlibs()
|
|
|
|
end
|
|
|
|
|
2017-08-12 09:25:25 +01:00
|
|
|
function vucode()
|
|
|
|
filter "files:**.dsm"
|
|
|
|
buildcommands {
|
|
|
|
'cpp "%{file.relpath}" | dvp-as -o "%{cfg.objdir}/%{file.basename}.o"'
|
|
|
|
}
|
|
|
|
buildoutputs { '%{cfg.objdir}/%{file.basename}.o' }
|
|
|
|
filter {}
|
|
|
|
end
|
|
|
|
|
2020-04-28 16:24:26 +01:00
|
|
|
project "playground"
|
2017-08-09 23:42:33 +01:00
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
2020-04-28 16:24:26 +01:00
|
|
|
skeltool("playground")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2017-08-09 23:42:33 +01:00
|
|
|
removeplatforms { "*null" }
|
2017-08-29 13:05:45 +01:00
|
|
|
removeplatforms { "ps2" } -- for now
|
2017-08-12 09:25:25 +01:00
|
|
|
|
2017-12-30 10:43:17 +00:00
|
|
|
project "imguitest"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("imguitest")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2020-04-19 12:00:35 +01:00
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|
|
|
|
project "lights"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("lights")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2017-12-30 10:43:17 +00:00
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|
2021-03-03 15:43:20 +00:00
|
|
|
project "subrast"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("subrast")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2021-03-03 15:43:20 +00:00
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|
2021-03-03 20:53:06 +00:00
|
|
|
project "camera"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("camera")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2021-03-03 20:53:06 +00:00
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|
2021-03-09 22:52:11 +00:00
|
|
|
project "im2d"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("im2d")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2021-03-09 22:52:11 +00:00
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|
2021-03-10 00:13:17 +00:00
|
|
|
project "im3d"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("im3d")
|
2021-07-09 18:58:23 +01:00
|
|
|
entrypoint("WinMainCRTStartup")
|
2021-03-10 00:13:17 +00:00
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|
2020-08-06 09:00:46 +01:00
|
|
|
project "ska2anm"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
targetdir (Bindir)
|
|
|
|
files { path.join("tools/ska2anm", "*.cpp"),
|
|
|
|
path.join("tools/ska2anm", "*.h") }
|
|
|
|
debugdir ( path.join("tools/ska2nm") )
|
|
|
|
includedirs { "." }
|
|
|
|
libdirs { Libdir }
|
|
|
|
links { "librw" }
|
|
|
|
findlibs()
|
|
|
|
removeplatforms { "*gl3", "*d3d9", "*ps2" }
|
|
|
|
|
2017-08-12 09:25:25 +01:00
|
|
|
project "ps2test"
|
|
|
|
kind "ConsoleApp"
|
|
|
|
targetdir (Bindir)
|
|
|
|
vucode()
|
|
|
|
removeplatforms { "*gl3", "*d3d9", "*null" }
|
|
|
|
targetextension '.elf'
|
|
|
|
includedirs { "." }
|
|
|
|
files { "tools/ps2test/*.cpp",
|
|
|
|
"tools/ps2test/vu/*.dsm",
|
|
|
|
"tools/ps2test/*.h" }
|
|
|
|
libdirs { "$(PS2SDK)/ee/lib" }
|
|
|
|
links { "librw" }
|
2017-08-18 18:28:01 +01:00
|
|
|
|
2017-08-29 13:05:45 +01:00
|
|
|
--project "ps2rastertest"
|
|
|
|
-- kind "ConsoleApp"
|
|
|
|
-- targetdir (Bindir)
|
|
|
|
-- removeplatforms { "*gl3", "*d3d9" }
|
|
|
|
-- files { "tools/ps2rastertest/*.cpp" }
|
|
|
|
-- includedirs { "." }
|
|
|
|
-- libdirs { Libdir }
|
|
|
|
-- links { "librw" }
|
2021-11-25 13:17:44 +00:00
|
|
|
|
|
|
|
project "hopalong"
|
|
|
|
kind "WindowedApp"
|
|
|
|
characterset ("MBCS")
|
|
|
|
skeltool("hopalong")
|
|
|
|
entrypoint("WinMainCRTStartup")
|
|
|
|
removeplatforms { "*null" }
|
|
|
|
removeplatforms { "ps2" }
|
|
|
|
|