workaround of premake for link error on Ubuntu/Linux, see
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
"../GpuDemos/gwenUserInterface.h"
|
"../GpuDemos/gwenUserInterface.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.is("Linux") then links{"X11"} end
|
if os.is("Linux") then links{"X11","pthread"} end
|
||||||
if os.is("MacOSX") then
|
if os.is("MacOSX") then
|
||||||
links{"Cocoa.framework"}
|
links{"Cocoa.framework"}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ function createProject(vendor)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
links{"X11"}
|
links{"X11","pthread"}
|
||||||
files {
|
files {
|
||||||
"../../btgui/OpenGLWindow/X11OpenGLWindow.cpp",
|
"../../btgui/OpenGLWindow/X11OpenGLWindow.cpp",
|
||||||
"../../btgui/OpenGLWindow/X11OpenGLWindows.h"
|
"../../btgui/OpenGLWindow/X11OpenGLWindows.h"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function createProject(vendor)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
links {"X11"}
|
links {"X11","pthread"}
|
||||||
files {
|
files {
|
||||||
"../../btgui/OpenGLWindow/X11OpenGLWindow.cpp",
|
"../../btgui/OpenGLWindow/X11OpenGLWindow.cpp",
|
||||||
"../../btgui/OpenGLWindow/X11OpenGLWindows.h"
|
"../../btgui/OpenGLWindow/X11OpenGLWindows.h"
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ if os.is("Windows") then
|
|||||||
"../../btgui/OpenGLWindow/X11OpenGLWindow.h",
|
"../../btgui/OpenGLWindow/X11OpenGLWindow.h",
|
||||||
"../../btgui/OpenGLWindow/X11OpenGLWindow.cpp"
|
"../../btgui/OpenGLWindow/X11OpenGLWindow.cpp"
|
||||||
}
|
}
|
||||||
|
links{"pthread"}
|
||||||
end
|
end
|
||||||
if os.is("MacOSX") then
|
if os.is("MacOSX") then
|
||||||
links{"Cocoa.framework"}
|
links{"Cocoa.framework"}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.is("Linux") then links {"X11"} end
|
if os.is("Linux") then links {"X11","pthread"} end
|
||||||
|
|
||||||
if os.is("MacOSX") then
|
if os.is("MacOSX") then
|
||||||
links{"Cocoa.framework"}
|
links{"Cocoa.framework"}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
"../OpenGLWindow/X11OpenGLWindow.h",
|
"../OpenGLWindow/X11OpenGLWindow.h",
|
||||||
"../OpenGLWindow/X11OpenGLWindow.cpp"
|
"../OpenGLWindow/X11OpenGLWindow.cpp"
|
||||||
}
|
}
|
||||||
|
links{"pthread"}
|
||||||
end
|
end
|
||||||
if os.is("MacOSX") then
|
if os.is("MacOSX") then
|
||||||
links{"Cocoa.framework"}
|
links{"Cocoa.framework"}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };
|
GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };
|
||||||
|
|
||||||
|
|
||||||
@@ -82,6 +84,13 @@ void X11OpenGLWindow::enableOpenGL()
|
|||||||
printf("GL_VERSION=%s\n", ver);
|
printf("GL_VERSION=%s\n", ver);
|
||||||
const GLubyte* sl = glGetString(GL_SHADING_LANGUAGE_VERSION);
|
const GLubyte* sl = glGetString(GL_SHADING_LANGUAGE_VERSION);
|
||||||
printf("GL_SHADING_LANGUAGE_VERSION=%s\n", sl);
|
printf("GL_SHADING_LANGUAGE_VERSION=%s\n", sl);
|
||||||
|
|
||||||
|
//Access pthreads as a workaround for a bug in Linux/Ubuntu
|
||||||
|
//See https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642
|
||||||
|
|
||||||
|
int i=pthread_getconcurrency();
|
||||||
|
printf("pthread_getconcurrency()=%d\n",i);
|
||||||
|
|
||||||
// const GLubyte* ext = glGetString(GL_EXTENSIONS);
|
// const GLubyte* ext = glGetString(GL_EXTENSIONS);
|
||||||
// printf("GL_EXTENSIONS=%s\n", ext);
|
// printf("GL_EXTENSIONS=%s\n", ext);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,9 @@
|
|||||||
"Win32Window.h",
|
"Win32Window.h",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
if not os.is("Linux") then
|
if os.is("Linux") then
|
||||||
|
links {"pthread"}
|
||||||
|
else
|
||||||
excludes {
|
excludes {
|
||||||
"X11OpenGLWindow.cpp",
|
"X11OpenGLWindow.cpp",
|
||||||
"X11OpenGLWindows.h"
|
"X11OpenGLWindows.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user