Static build, fix duplicate symbol

This commit is contained in:
TotallyNotElite 2020-09-03 01:03:39 +02:00
parent 920a531cc5
commit 97462b57c8
3 changed files with 10 additions and 6 deletions

View File

@ -22,9 +22,9 @@ if(NOT (X11_Xext_FOUND AND X11_Xfixes_FOUND))
message(FATAL_ERROR "Please install Xext and Xfixes") message(FATAL_ERROR "Please install Xext and Xfixes")
endif() endif()
add_library(${PROJECT_NAME} SHARED "") add_library(${PROJECT_NAME} STATIC "")
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-m32 -fPIC" LINK_FLAGS "-m32 -fPIC")
target_include_directories(${PROJECT_NAME} PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
$<BUILD_INTERFACE:${GLEW_INCLUDE_DIRS}> $<BUILD_INTERFACE:${GLEW_INCLUDE_DIRS}>

View File

@ -11,12 +11,14 @@
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glx.h> #include <GL/glx.h>
struct xoverlay_glx_state typedef struct
{ {
int version_major; int version_major;
int version_minor; int version_minor;
GLXContext context; GLXContext context;
} glx_state; } xoverlay_glx_state;
extern xoverlay_glx_state glx_state;
int xoverlay_glx_init(); int xoverlay_glx_init();
int xoverlay_glx_create_window(); int xoverlay_glx_create_window();

View File

@ -24,6 +24,8 @@ typedef GLXContext (*glXCreateContextAttribsARBfn)(Display *, GLXFBConfig,
GLXContext, Bool, GLXContext, Bool,
const int *); const int *);
xoverlay_glx_state glx_state;
// Helper to check for extension string presence. Adapted from: // Helper to check for extension string presence. Adapted from:
// http://www.opengl.org/resources/features/OGLextensions/ // http://www.opengl.org/resources/features/OGLextensions/
int glx_is_extension_supported(const char *list, const char *extension) int glx_is_extension_supported(const char *list, const char *extension)
@ -101,7 +103,7 @@ int xoverlay_glx_create_window()
{ {
XVisualInfo *info = XVisualInfo *info =
glXGetVisualFromFBConfig(xoverlay_library.display, fbc[i]); glXGetVisualFromFBConfig(xoverlay_library.display, fbc[i]);
if (info->depth != 32) if (info->depth >= 32)
continue; continue;
int samples; int samples;
glXGetFBConfigAttrib(xoverlay_library.display, fbc[i], GLX_SAMPLES, glXGetFBConfigAttrib(xoverlay_library.display, fbc[i], GLX_SAMPLES,