librw/premake5.lua

170 lines
4.2 KiB
Lua
Raw Normal View History

2017-08-09 16:57:32 +08:00
GLEWdir = "C:/Users/aap/src/glew-2.1.0"
GLFW64dir = "C:/Users/aap/src/glfw-3.2.1.bin.WIN64"
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 16:25:25 +08:00
"linux-amd64-null", "linux-amd64-gl3",
"ps2" }
filter {}
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release*"
defines { "NDEBUG" }
optimize "On"
filter "configurations:ReleaseStatic"
flags { "StaticRuntime" }
filter { "platforms:*null" }
defines { "RW_NULL" }
filter { "platforms:*gl3" }
defines { "RW_GL3" }
filter { "platforms:*d3d9" }
defines { "RW_D3D9" }
2017-08-12 16:25:25 +08:00
filter { "platforms:ps2" }
defines { "RW_PS2" }
2017-08-12 16:25:25 +08:00
toolset "gcc"
gccprefix 'ee-'
buildoptions { "-nostdlib", "-fno-common" }
includedirs { "$(PS2SDK)/ee/include", "$(PS2SDK)/common/include" }
filter { "platforms:*amd64*" }
architecture "x86_64"
filter { "platforms:*x86*" }
architecture "x86"
filter { "platforms:win*" }
system "windows"
filter { "platforms:linux*" }
system "linux"
2017-07-27 21:05:30 +08:00
2017-08-09 16:57:32 +08:00
filter { "platforms:win*gl3" }
defines { "GLEW_STATIC" }
includedirs { path.join(GLEWdir, "include") }
includedirs { path.join(GLFW64dir, "include") }
2017-07-27 21:05:30 +08:00
filter "action:vs*"
2017-08-09 16:57:32 +08:00
buildoptions { "/wd4996", "/wd4244" }
2017-07-27 21:05:30 +08:00
filter {}
Libdir = "lib/%{cfg.platform}/%{cfg.buildcfg}"
Bindir = "bin/%{cfg.platform}/%{cfg.buildcfg}"
project "librw"
kind "StaticLib"
targetname "rw"
targetdir (Libdir)
files { "src/*.*" }
files { "src/*/*.*" }
project "dumprwtree"
kind "ConsoleApp"
targetdir (Bindir)
2017-08-24 21:10:34 +08:00
removeplatforms { "*gl3", "*d3d9", "ps2" }
files { "tools/dumprwtree/*" }
includedirs { "." }
libdirs { Libdir }
2017-07-27 21:05:30 +08:00
links { "librw" }
2017-08-10 06:42:33 +08:00
function findlibs()
filter { "platforms:linux*gl3" }
links { "GL", "GLEW", "glfw" }
filter { "platforms:win*gl3" }
defines { "GLEW_STATIC" }
filter { "platforms:win-amd64-gl3" }
libdirs { path.join(GLEWdir, "lib/Release/x64") }
libdirs { path.join(GLFW64dir, "lib-vc2015") }
filter { "platforms:win-x86-gl3" }
libdirs { path.join(GLEWdir, "lib/Release/Win32") }
filter { "platforms:win*gl3" }
links { "glew32s", "glfw3", "opengl32" }
filter { "platforms:*d3d9" }
links { "d3d9", "Xinput9_1_0" }
filter {}
end
function skeleton()
files { "skeleton/*.cpp", "skeleton/*.h" }
2017-12-30 18:43:17 +08:00
files { "skeleton/imgui/*.cpp", "skeleton/imgui/*.h" }
2017-08-10 06:42:33 +08: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 16:25:25 +08: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
2017-08-10 06:42:33 +08:00
project "clumpview"
kind "WindowedApp"
characterset ("MBCS")
skeltool("clumpview")
flags { "WinMain" }
removeplatforms { "*null" }
2017-08-29 20:05:45 +08:00
removeplatforms { "ps2" } -- for now
2017-08-12 16:25:25 +08:00
2017-12-30 18:43:17 +08:00
project "imguitest"
kind "WindowedApp"
characterset ("MBCS")
skeltool("imguitest")
files { "tools/imguitest/imgui/*.cpp" }
flags { "WinMain" }
removeplatforms { "*null" }
removeplatforms { "ps2" }
2017-08-12 16:25:25 +08: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" }
linkoptions '$(PS2SDK)/ee/startup/crt0.o'
linkoptions { '-mno-crt0', "-T$(PS2SDK)/ee/startup/linkfile" }
libdirs { "$(PS2SDK)/ee/lib" }
links { "librw" }
-- "c -lc" is a hack because we need -lc twice for some reason
links { "c -lc", "kernel", "mf" }
2017-08-19 01:28:01 +08:00
2017-08-29 20:05:45 +08:00
--project "ps2rastertest"
-- kind "ConsoleApp"
-- targetdir (Bindir)
-- removeplatforms { "*gl3", "*d3d9" }
-- files { "tools/ps2rastertest/*.cpp" }
-- includedirs { "." }
-- libdirs { Libdir }
-- links { "librw" }