mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
premake4: add option to force dynamic loading of OpenGL and X11
--force_dlopen_opengl and --force_dlopen_x11
This commit is contained in:
parent
bf1bd07636
commit
d93b27f16c
@ -14,8 +14,8 @@
|
||||
configuration {"MacOSX"}
|
||||
links { "OpenGL.framework"}
|
||||
configuration {"not Windows", "not MacOSX"}
|
||||
if os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h") then
|
||||
links {"GL","GLU"}
|
||||
if not _OPTIONS["force_dlopen_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h")) then
|
||||
links {"GL"}
|
||||
else
|
||||
print("No GL/gl.h found, using dynamic loading of GL using glew")
|
||||
defines {"GLEW_INIT_OPENGL11_FUNCTIONS=1"}
|
||||
@ -57,16 +57,17 @@
|
||||
end
|
||||
if os.is("Linux") then
|
||||
configuration{"Linux"}
|
||||
--if os.isdir("/usr/include") and os.isfile("/usr/include/GL/glew.h") then
|
||||
-- links {"GLEW"}
|
||||
-- else
|
||||
--print("Using static glew and dynamic loading of glx functions")
|
||||
if not _OPTIONS["force_dlopen_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h") and os.isfile("/usr/include/GL/glew.h")) then
|
||||
links {"GLEW"}
|
||||
else
|
||||
print("Using static glew and dynamic loading of glx functions")
|
||||
defines { "GLEW_STATIC","GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
||||
includedirs {
|
||||
projectRootDir .. "btgui/OpenGLWindow/GlewWindows"
|
||||
}
|
||||
files { projectRootDir .. "btgui/OpenGLWindow/GlewWindows/glew.c"}
|
||||
-- end
|
||||
links {"dl"}
|
||||
end
|
||||
|
||||
end
|
||||
configuration{}
|
||||
@ -74,7 +75,7 @@
|
||||
|
||||
function initX11()
|
||||
if os.is("Linux") then
|
||||
if os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h") then
|
||||
if not _OPTIONS["force_dlopen_x11"] and (os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h")) then
|
||||
links{"X11","pthread"}
|
||||
else
|
||||
print("No X11/X.h found, using dynamic loading of X11")
|
||||
|
@ -12,6 +12,19 @@
|
||||
act = _ACTION
|
||||
end
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "force_dlopen_opengl",
|
||||
description = "Dynamically load OpenGL (instead of static/dynamic linking)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "force_dlopen_x11",
|
||||
description = "Dynamically load OpenGL (instead of static/dynamic linking)"
|
||||
}
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "midi",
|
||||
|
Loading…
Reference in New Issue
Block a user