summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@DESKTOP-MH9K9U5.localdomain>2020-07-18 07:40:40 -0700
committerroot <root@DESKTOP-MH9K9U5.localdomain>2020-07-18 07:40:40 -0700
commit6af885aa12dfd1dce0fc7353743b23bafdc7f210 (patch)
treeadc3bcaaa7780f628a0ba97d254e012bd45fce7a
parent89328def0f22cf2cb74977a2b8af5d17899597f8 (diff)
downloadbullet3-6af885aa12dfd1dce0fc7353743b23bafdc7f210.tar.gz
fix premake4 script when X11 is missing
-rw-r--r--build3/findOpenGLGlewGlut.lua34
1 files changed, 18 insertions, 16 deletions
diff --git a/build3/findOpenGLGlewGlut.lua b/build3/findOpenGLGlewGlut.lua
index 5d53a25d9..bf8866dec 100644
--- a/build3/findOpenGLGlewGlut.lua
+++ b/build3/findOpenGLGlewGlut.lua
@@ -44,6 +44,22 @@
end
+ function initX11()
+ if os.is("Linux") then
+ if _OPTIONS["enable_system_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")
+ includedirs {
+ projectRootDir .. "examples/ThirdPartyLibs/optionalX11"
+ }
+ defines {"DYNAMIC_LOAD_X11_FUNCTIONS"}
+ links {"dl","pthread"}
+ end
+ end
+ end
+
+
function initGlew()
configuration {}
if os.is("Windows") then
@@ -63,8 +79,9 @@
if os.is("Linux") then
configuration{"Linux"}
+ initX11()
if _OPTIONS["enable_system_glx"] then --# and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/glx.h")) then
- links{"X11","pthread"}
+ links{"pthread"}
print("Using system GL/glx.h")
else
print("Using glad_glx")
@@ -86,18 +103,3 @@
configuration{}
end
- function initX11()
- if os.is("Linux") then
- if _OPTIONS["enable_system_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")
- includedirs {
- projectRootDir .. "examples/ThirdPartyLibs/optionalX11"
- }
- defines {"DYNAMIC_LOAD_X11_FUNCTIONS"}
- links {"dl","pthread"}
- end
- end
- end
-