linux fixes, bugfixes, comments
This commit is contained in:
174
premake5.lua
174
premake5.lua
@ -2,7 +2,7 @@
|
||||
-- Bounce premake script
|
||||
-- http://industriousone.com/premake
|
||||
|
||||
-- paths as variables in the case files are moved
|
||||
-- variable paths for the case files are moved
|
||||
solution_name = "bounce"
|
||||
working_dir = "."
|
||||
solution_dir = "build/"
|
||||
@ -12,7 +12,8 @@ src_dir = "src/"
|
||||
obj_dir = "/obj/"
|
||||
bin_dir = "/bin/"
|
||||
|
||||
action = _ACTION
|
||||
-- or "" to make --help work
|
||||
action = _ACTION or ""
|
||||
|
||||
-- premake main
|
||||
solution (solution_name)
|
||||
@ -20,14 +21,6 @@ solution (solution_name)
|
||||
configurations { "debug", "release" }
|
||||
platforms { "x32", "x64" }
|
||||
|
||||
filter { "platforms:x32" }
|
||||
system "windows"
|
||||
architecture "x32"
|
||||
|
||||
filter { "platforms:x64" }
|
||||
system "windows"
|
||||
architecture "x64"
|
||||
|
||||
-- note the use of "!" before objdir to force the specified path
|
||||
configuration "debug"
|
||||
targetdir ( solution_dir .. action .. bin_dir .. "%{cfg.platform}/%{cfg.buildcfg}/%{prj.name}" )
|
||||
@ -37,125 +30,187 @@ solution (solution_name)
|
||||
rtti "Off"
|
||||
flags { "FloatFast" }
|
||||
|
||||
configuration "release"
|
||||
configuration "release"
|
||||
targetdir ( solution_dir .. action .. bin_dir .. "%{cfg.platform}/%{cfg.buildcfg}/%{prj.name}" )
|
||||
objdir ( "!" .. solution_dir .. action .. obj_dir .. "%{cfg.platform}/%{cfg.buildcfg}/%{prj.name}" )
|
||||
defines { "NDEBUG" }
|
||||
optimize "On"
|
||||
rtti "Off"
|
||||
flags { "FloatFast" }
|
||||
|
||||
configuration "windows"
|
||||
defines { "WIN32", "_WINDOWS" }
|
||||
|
||||
|
||||
configuration { "vs*" }
|
||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||
|
||||
configuration { "windows" }
|
||||
defines { "_WIN32", "WIN32", "_WINDOWS" }
|
||||
|
||||
project "bounce"
|
||||
kind "StaticLib"
|
||||
language "C++"
|
||||
location ( solution_dir .. action )
|
||||
includedirs { inc_dir }
|
||||
vpaths { [""] = "bounce" }
|
||||
buildoptions { "-std=c++11" } -- require C++11
|
||||
|
||||
files
|
||||
{
|
||||
inc_dir .. "/bounce/**.h",
|
||||
inc_dir .. "/bounce/**.inl",
|
||||
src_dir .. "/bounce/**.cpp"
|
||||
}
|
||||
includedirs { inc_dir }
|
||||
vpaths { [""] = "bounce" }
|
||||
|
||||
project "glad"
|
||||
kind "StaticLib"
|
||||
language "C"
|
||||
location ( solution_dir .. action )
|
||||
includedirs { external_dir }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.c" }
|
||||
|
||||
files
|
||||
{
|
||||
external_dir .. "/glad/**.h",
|
||||
external_dir .. "/glad/**.c"
|
||||
external_dir .. "/glad/khrplatform.h",
|
||||
external_dir .. "/glad/glad.h",
|
||||
external_dir .. "/glad/glad.c"
|
||||
}
|
||||
includedirs { external_dir }
|
||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.c" }
|
||||
|
||||
configuration { "not windows", "not macosx" }
|
||||
files
|
||||
{
|
||||
external_dir .. "/glad/glad_glx.h",
|
||||
external_dir .. "/glad/glad_glx.c"
|
||||
}
|
||||
|
||||
project "glfw"
|
||||
kind "StaticLib"
|
||||
language "C"
|
||||
location ( solution_dir .. action )
|
||||
includedirs { external_dir .. "/glfw" }
|
||||
defines { "_GLFW_USE_CONFIG_H" } -- see glfw_config.h
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.c" }
|
||||
|
||||
-- files
|
||||
|
||||
-- windows headers and sources
|
||||
-- common
|
||||
files
|
||||
{
|
||||
external_dir .. "/glfw/glfw_config.h",
|
||||
external_dir .. "/glfw/glfw3.h",
|
||||
external_dir .. "/glfw/glfw3native.h",
|
||||
|
||||
external_dir .. "/glfw/context.c",
|
||||
external_dir .. "/glfw/init.c",
|
||||
external_dir .. "/glfw/input.c",
|
||||
external_dir .. "/glfw/monitor.c",
|
||||
external_dir .. "/glfw/vulkan.c",
|
||||
external_dir .. "/glfw/window.c",
|
||||
}
|
||||
|
||||
-- windows
|
||||
configuration { "windows" }
|
||||
files
|
||||
{
|
||||
external_dir .. "/glfw/egl_context.h",
|
||||
external_dir .. "/glfw/glfw3.h",
|
||||
external_dir .. "/glfw/glfw3native.h",
|
||||
external_dir .. "/glfw/glfw_config.h",
|
||||
external_dir .. "/glfw/wgl_context.h",
|
||||
external_dir .. "/glfw/win32_joystick.h",
|
||||
external_dir .. "/glfw/win32_platform.h",
|
||||
|
||||
external_dir .. "/glfw/context.c",
|
||||
external_dir .. "/glfw/egl_context.c",
|
||||
external_dir .. "/glfw/init.c",
|
||||
external_dir .. "/glfw/input.c",
|
||||
external_dir .. "/glfw/monitor.c",
|
||||
external_dir .. "/glfw/vulkan.c",
|
||||
external_dir .. "/glfw/wgl_context.c",
|
||||
external_dir .. "/glfw/win32_joystick.h",
|
||||
external_dir .. "/glfw/wgl_context.h",
|
||||
external_dir .. "/glfw/egl_context.h",
|
||||
|
||||
external_dir .. "/glfw/win32_init.c",
|
||||
external_dir .. "/glfw/win32_joystick.c",
|
||||
external_dir .. "/glfw/win32_monitor.c",
|
||||
external_dir .. "/glfw/win32_time.c",
|
||||
external_dir .. "/glfw/win32_tls.c",
|
||||
external_dir .. "/glfw/win32_window.c",
|
||||
external_dir .. "/glfw/window.c"
|
||||
external_dir .. "/glfw/wgl_context.c",
|
||||
external_dir .. "/glfw/egl_context.c",
|
||||
}
|
||||
includedirs { external_dir .. "/glfw" }
|
||||
defines { "_GLFW_USE_CONFIG_H", "_CRT_SECURE_NO_WARNINGS" }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.c" }
|
||||
|
||||
-- linux
|
||||
configuration { "not windows", "not macosx" }
|
||||
buildoptions { "-pthread" }
|
||||
files
|
||||
{
|
||||
external_dir .. "/glfw/x11_platform.h",
|
||||
external_dir .. "/glfw/xkb_unicode.h",
|
||||
external_dir .. "/glfw/linux_joystick.h",
|
||||
external_dir .. "/glfw/posix_time.h",
|
||||
external_dir .. "/glfw/posix_tls.h",
|
||||
external_dir .. "/glfw/glx_context.h",
|
||||
external_dir .. "/glfw/egl_context.h",
|
||||
|
||||
external_dir .. "/glfw/x11_init.c",
|
||||
external_dir .. "/glfw/x11_monitor.c",
|
||||
external_dir .. "/glfw/x11_window.c",
|
||||
external_dir .. "/glfw/xkb_unicode.c",
|
||||
external_dir .. "/glfw/linux_joystick.c",
|
||||
external_dir .. "/glfw/posix_time.c",
|
||||
external_dir .. "/glfw/posix_tls.c",
|
||||
external_dir .. "/glfw/egl_context.c",
|
||||
external_dir .. "/glfw/glx_context.c",
|
||||
}
|
||||
|
||||
project "imgui"
|
||||
kind "StaticLib"
|
||||
language "C++"
|
||||
location ( solution_dir .. action )
|
||||
includedirs { external_dir }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.cpp" }
|
||||
buildoptions { "-std=c++11" } -- require C++11
|
||||
|
||||
files
|
||||
{
|
||||
external_dir .. "/imgui/**.h",
|
||||
external_dir .. "/imgui/**.cpp"
|
||||
}
|
||||
includedirs { external_dir }
|
||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.cpp" }
|
||||
|
||||
project "testbed"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
location ( solution_dir .. action )
|
||||
includedirs { external_dir, inc_dir }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.cpp" }
|
||||
buildoptions { "-std=c++11" } -- require C++11
|
||||
|
||||
--common
|
||||
files
|
||||
{
|
||||
inc_dir .. "/testbed/**.h",
|
||||
src_dir .. "/testbed/**.cpp"
|
||||
}
|
||||
includedirs { external_dir, inc_dir }
|
||||
|
||||
-- dependencies
|
||||
links { "bounce", "glad", "glfw", "imgui" }
|
||||
|
||||
-- windows dependencies
|
||||
|
||||
links { "glfw", "glad", "imgui", "bounce" }
|
||||
|
||||
configuration { "windows" }
|
||||
links { "glu32", "opengl32", "winmm" }
|
||||
vpaths { ["Headers"] = "**.h", ["Sources"] = "**.cpp" }
|
||||
|
||||
configuration { "not windows", "not macosx" }
|
||||
links
|
||||
{
|
||||
"GL", "GLU", "rt", "Xrandr", "Xinerama", "Xi", "Xcursor",
|
||||
"m", "dl", "Xrender", "drm", "Xdamage", "X11-xcb", "xcb-glx",
|
||||
"xcb-dri2", "xcb-dri3", "xcb-present", "xcb-sync", "xshmfence",
|
||||
"Xxf86vm", "Xfixes", "Xext", "X11", "pthread", "xcb", "Xau", "Xdmcp"
|
||||
}
|
||||
|
||||
-- build
|
||||
if os.is "windows" then
|
||||
|
||||
newaction
|
||||
{
|
||||
{
|
||||
trigger = "solution",
|
||||
description = "Make and open solution",
|
||||
description = "Build solution",
|
||||
execute = function ()
|
||||
os.execute ( "premake5 clean" )
|
||||
os.execute ( "premake5 clean" )
|
||||
os.execute ( "premake5 vs2015" )
|
||||
os.execute ( "start " .. solution_dir .. "vs2015/bounce.sln" )
|
||||
end
|
||||
}
|
||||
|
||||
newaction
|
||||
{
|
||||
trigger = "doc",
|
||||
description = "Build documentation",
|
||||
execute = function ()
|
||||
os.execute ( "doxygen doxyfile" )
|
||||
os.execute ( "start doc\\api\\html\\index.html" )
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
-- clean
|
||||
@ -164,6 +219,7 @@ newaction
|
||||
trigger = "clean",
|
||||
description = "Clean solution",
|
||||
execute = function ()
|
||||
os.rmdir( solution_dir )
|
||||
os.rmdir( "doc" )
|
||||
os.rmdir( solution_dir )
|
||||
end
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user