premake: disable linking system OpenGL and X11 by default,
use dlopen to dynamically load GL/X11
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
links { "OpenGL.framework"}
|
links { "OpenGL.framework"}
|
||||||
configuration {"not Windows", "not MacOSX"}
|
configuration {"not Windows", "not MacOSX"}
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
if not _OPTIONS["force_dlopen_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h")) then
|
if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h")) then
|
||||||
links {"GL"}
|
links {"GL"}
|
||||||
else
|
else
|
||||||
print("No GL/gl.h found, using dynamic loading of GL using glew")
|
print("No GL/gl.h found, using dynamic loading of GL using glew")
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
end
|
end
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
configuration{"Linux"}
|
configuration{"Linux"}
|
||||||
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
|
if _OPTIONS["enable_system_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"}
|
links {"GLEW"}
|
||||||
print ("linking against system GLEW")
|
print ("linking against system GLEW")
|
||||||
else
|
else
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
function initX11()
|
function initX11()
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
if not _OPTIONS["force_dlopen_x11"] and (os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h")) then
|
if _OPTIONS["enable_system_x11"] and (os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h")) then
|
||||||
links{"X11","pthread"}
|
links{"X11","pthread"}
|
||||||
else
|
else
|
||||||
print("No X11/X.h found, using dynamic loading of X11")
|
print("No X11/X.h found, using dynamic loading of X11")
|
||||||
|
|||||||
@@ -25,14 +25,14 @@
|
|||||||
|
|
||||||
newoption
|
newoption
|
||||||
{
|
{
|
||||||
trigger = "force_dlopen_opengl",
|
trigger = "enable_system_opengl",
|
||||||
description = "Dynamically load OpenGL (instead of static/dynamic linking)"
|
description = "Try to link and use the system OpenGL headers version instead of dynamically loading OpenGL (dlopen is default)"
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption
|
newoption
|
||||||
{
|
{
|
||||||
trigger = "force_dlopen_x11",
|
trigger = "enable_system_x11",
|
||||||
description = "Dynamically load OpenGL (instead of static/dynamic linking)"
|
description = "Try to link and use system X11 headers instead of dynamically loading X11 (dlopen is default)"
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption
|
newoption
|
||||||
|
|||||||
Reference in New Issue
Block a user