Commit Graph

1177 Commits

Author SHA1 Message Date
grahamreeds
a4d8b2a2a3 Bump minimum cmake version to 3.16 matching the LTS release of Ubuntu 20.04 2023-09-22 07:03:54 +10:00
Kekschen
a98195b83d Updated comment in cmake-testbuild.sh 2023-07-16 09:29:54 +10:00
Jean-Christophe Fillion-Robin
281c2936f3 cmake: Update install rules to support component-based installation 2023-06-22 07:47:53 +10:00
NoamDev
ef7d12ecb7 Added to .gitignore auto-checkout out repos 2023-04-24 20:20:17 +10:00
NoamDev
6a53a2a200 Added to .gitignore auto-checkout out repos 2023-03-15 22:28:40 +10:00
Ned Loynd
52ce1cc575 Check the macOS deployment target before using dlfcn 2023-03-15 22:28:10 +10:00
Nigel Stewart
5a2307fae3 Fix issue #355 - GL_NVX_progress_fence missing glCreateProgressFenceNVX 2022-06-13 12:22:45 +10:00
Marvin Schmidt
c8a2ddfbe1 cmake: Link libGLX when X11 support is requested
Using cmake (version 3.23.0) the build fails to link the utils
```
[...]
[ 87%] Linking C executable bin/visualinfo                                                                                                                      [113/5249]
/usr/x86_64-pc-linux-gnu/bin/cmake -E cmake_link_script CMakeFiles/visualinfo.dir/link.txt --verbose=1
/usr/host/bin/x86_64-pc-linux-gnu-cc -Wall -g -ggdb3 -O0 -rdynamic CMakeFiles/visualinfo.dir/home/marv/scm/github/glew/src/visualinfo.c.o -o bin/visualinfo  -Wl,-rpath,/h
ome/marv/scm/github/glew/build-obj/lib: lib/libGLEW.so.2.2.0 -lSM -lICE -lX11 -lXext -lOpenGL -lSM -lICE -lX11 -lXext
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: CMakeFiles/visualinfo.dir/home/marv/scm/github/glew/src/visualinfo.c.o: in function `main':
/home/marv/scm/github/glew/src/visualinfo.c:198: undefined reference to `glXQueryExtensionsString'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: CMakeFiles/visualinfo.dir/home/marv/scm/github/glew/src/visualinfo.c.o: in function `CreateContext':
/home/marv/scm/github/glew/src/visualinfo.c:1204: undefined reference to `glXQueryExtension'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: /home/marv/scm/github/glew/src/visualinfo.c:1206: undefined reference to `glXChooseVisual'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: /home/marv/scm/github/glew/src/visualinfo.c:1209: undefined reference to `glXCreateContext'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: /home/marv/scm/github/glew/src/visualinfo.c:1221: undefined reference to `glXMakeCurrent'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: CMakeFiles/visualinfo.dir/home/marv/scm/github/glew/src/visualinfo.c.o: in function `DestroyContext':
/home/marv/scm/github/glew/src/visualinfo.c:1227: undefined reference to `glXDestroyContext'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: lib/libGLEW.so.2.2.0: undefined reference to `glXGetProcAddressARB'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: lib/libGLEW.so.2.2.0: undefined reference to `glXQueryVersion'
/usr/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ld: lib/libGLEW.so.2.2.0: undefined reference to `glXGetClientString'
collect2: error: ld returned 1 exit status
```

Commit 2b50f4a ("CMake: Prefer GLVND if available") changed the cmake
policy CMP0072 to `NEW` in order to make the FindOpenGL module prefer the
GLVND libraries (libOpenGL and libGLX) over the legacy GL library (libGL).

The help of the CMP0072 policy states:

> CMP0072
> -------
>
> .. versionadded:: 3.11
>
> ``FindOpenGL`` prefers GLVND by default when available.
>
> The ``FindOpenGL`` module provides an ``OpenGL::GL`` target and an
> ``OPENGL_LIBRARIES`` variable for projects to use for legacy GL interfaces.
> When both a legacy GL library (e.g. ``libGL.so``) and GLVND libraries
> for OpenGL and GLX (e.g. ``libOpenGL.so`` and ``libGLX.so``) are available,
> the module must choose between them.  It documents an ``OpenGL_GL_PREFERENCE``
> variable that can be used to specify an explicit preference.  When no such
> preference is set, the module must choose a default preference.
>
> CMake 3.11 and above prefer to choose GLVND libraries.  This policy provides
> compatibility with projects that expect the legacy GL library to be used.
>
> The ``OLD`` behavior for this policy is to set ``OpenGL_GL_PREFERENCE`` to
> ``LEGACY``.  The ``NEW`` behavior for this policy is to set
> ``OpenGL_GL_PREFERENCE`` to ``GLVND``.
>
> This policy was introduced in CMake version 3.11.  CMake version
> 3.23.0 warns when the policy is not set and uses ``OLD`` behavior.
> Use the ``cmake_policy()`` command to set it to ``OLD`` or ``NEW``
> explicitly.
>
> .. note::
>   The ``OLD`` behavior of a policy is
>   ``deprecated by definition``
>   and may be removed in a future version of CMake.

The changes from the mentioned commit combined with the new behaviour of
the FindOpenGL module resulted in the glew library being linked against
`libOpenGL` instead of `libGL`, but not `libGLX`. Since `libOpenGL`
doesn't link against GLX compared to `libGL` the linker errors above
surfaced. Fix this by explicitly linking against libGLX if GLEW_X11 is
enabled
2022-06-13 12:22:14 +10:00
ibbem
37e6144802 Remove broken end of string checks in _glewStrSame
I think this code tried to check for a zero terminated null byte, but it
actually just checked if the address of the corresponding character is
non-zero, which is always true. These broken checks are simply dropped
because the following code assumes that the string `b` doesn't include a
null byte and all call sites already pass the length of the string
without counting the null byte.

This bug was found by gcc 12.1 which emits a warning on this kind of
code. Now glew builds without any warnings using gcc 12.1. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103 for the
corresponding issue.
2022-06-13 12:21:23 +10:00
Nigel Stewart
2c4c183c34 README: travis-ci is no longer relevant 2022-04-02 12:39:09 +10:00
Bertie Wheen
c6673b15bf Remove unnecessary code
Resolves #349 (I think)
2022-04-02 12:30:19 +10:00
Nigel Stewart
55c8b94608 Add link for snapshot glew-20220402.tgz 2022-04-02 12:25:25 +10:00
G'lek Tarssza
35d928bc77 Fixed failing build on Windows when using LLVM.
Failure caused by `llvm-rc` failing on non-ASCII code point for
copyright symbol.
2022-02-20 18:52:10 +10:00
René Schwaiger
5dbae5a837 Make: Remove 32 bit support from universal build
Installing the library fails on macOS 12, if we use the compiler flags
for the i386 architecture.

See also:

- https://github.com/nigels-com/glew/pull/348#issuecomment-1032874467
2022-02-09 19:58:09 +10:00
René Schwaiger
5239c3ae21 Make: Support Apple Silicon in universal build 2022-02-09 19:58:09 +10:00
Marvin Schmidt
5f57b09c04 cmake: Install eglew.h
The eglew.h header was never installed using the CMake build. Fix this
by adding it to the list of public headers
2022-02-09 08:15:29 +10:00
Dmitry Kalinkin
966e53fa15 CMake: don't hardcode "<prefix>/include" in target_include_directories 2022-01-07 12:54:49 +10:00
Nigel Stewart
3f922b3dc6 Updated config.guess from https://github.com/gcc-mirror/gcc/blob/master/config.guess 2021-12-23 10:58:37 +10:00
luz paz
4a757ac7c0 Fix various typos
Found via `codespell -q 3 -L ake,extrem,lod,parms`
2021-12-20 07:31:49 +10:00
Vanfanel
062067f2ba Specify that EGL/GLVND doesn't use GLU. 2021-10-29 09:13:42 +10:00
Vanfanel
8e2e31e69b Add support for building against vendor-neutral GLVND instead of GLX on Linux/EGL 2021-10-29 07:14:15 +10:00
Nigel Stewart
037635a192 Disable stripping in debug-mode builds 2021-10-05 08:29:14 +10:00
Nigel Stewart
9e6361b357 visualinfo: EGL not supported yet, error out more clearly
Also, remove GLEW_MX support from visualinfo
2021-10-05 08:28:49 +10:00
Nigel Stewart
247baa9e20 For SYSTEM linux-mingw32 and linux-mingw64 default GLEW_DEST more appropriately 2021-10-05 08:28:12 +10:00
Nigel Stewart
d7693eea09 Makefile: don't strip in install step
As discussed in Issue #310 stripping the binaries is
done by the link targets, not needed for the install step.
Along the lines of a Yocto batch by Ross Burton <ross.burton@intel.com>
2021-10-05 08:27:27 +10:00
Nigel Stewart
715afa0ff5 Extend GLEW API to support glewContextInit - GL without implied GLX, WGL, EGL initialisation 2021-08-29 09:11:11 +10:00
Nigel Stewart
ea2076658a glewGetErrorString for GLEW_ERROR_NO_GLX_DISPLAY (added in 2016) 2021-08-29 09:10:04 +10:00
Ross Burton
767e031645 Fix build race in Makefile
The current rule for the binaries is:

glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN)

In parallel builds, all of those targets happen at the same time. This
means that 'bin' can happen *after* 'bin/$(GLEWINFO.BIN)', which is a
problem as the 'bin' target's responsibility is to create the directory
that the other target writes into.

Solve this by not having a separate 'create directory' target which is
fundamentally racy, and simply mkdir in each target which writes into it.
2021-07-23 18:21:23 +10:00
Ross Burton
679a3b17fa Install to /usr/local by default when using Makefiles
Software should install to /usr/local by default, as /usr is for the
operating system managed libraries.

Closes #52.
2021-07-23 18:21:23 +10:00
Daniel Bernar
80e061f85d Add ability to change output dirs
https://github.com/nigels-com/glew/issues/264
2021-03-21 12:41:32 +10:00
Julien Schueller
2b50f4acd2 CMake: Prefer GLVND if available 2021-03-21 12:41:04 +10:00
Julien Schueller
2b16160853 CMake: Add BUILD_SHARED_LIBS option 2021-03-21 12:41:04 +10:00
Julien Schueller
e34bb212f6 CMake: Add X11/EGL options 2021-03-21 12:41:04 +10:00
Xavier Bonaventura
fb0f210598 Use os.path.join to create paths
Paths should be created using os.path.join with this way is platform
independent.
2021-01-10 21:40:05 +10:00
Nigel Stewart
749aec8b9b Documentation refresh for GLEW 2.2.0, downloads from github 2021-01-10 12:23:57 +10:00
Danilo Spinella
95329dc4a6 GLEW_EGL: Fix EGL library check 2021-01-10 12:07:23 +10:00
Nigel Stewart
8c88a0858f EGLEW: Wayland wl_buffer declaration for WL_bind_wayland_display 2021-01-10 11:52:31 +10:00
Nigel Stewart
d68cb03149 EGLEW: Wayland wl_display and wl_resource declarations for WL_bind_wayland_display 2021-01-10 11:50:29 +10:00
Nigel Stewart
5b5685e39a README.md: Updates for GLEW 2.2.0 release, downloads via github 2021-01-10 11:42:18 +10:00
Nigel Stewart
0fa5d11024 Fixup: Install eglew.h too 2021-01-10 11:13:09 +10:00
Xavier Bonaventura
107ab7f6e9 Use list comprehension instead of extending the collection 2021-01-10 11:09:37 +10:00
Xavier Bonaventura
4e5fe20519 Use context manager instead of raw open
Raw open should be avoided to prevent that in case of an exception
the file is not closed.
This also has the advantage that if the user forgets to call close
the file is still closed.
2021-01-10 11:08:48 +10:00
Christian Rauch
3cdab58d4e fix typo 2020-12-13 23:24:55 +10:00
Nicolas Caramelli
75e3154422 The file include/GL/gl.h generated from OpenGL-Registry uses __gl_gl_h_ 2020-12-04 16:45:04 +10:00
Tim Gates
bfc724c6cc docs: fix simple typo, direcly -> directly
There is a small typo in auto/src/glew_head.c.

Should read `directly` rather than `direcly`.
2020-11-28 10:28:05 +10:00
Alexey Tereshenkov
0b97f2568d Rename lgtm.yml to hide the file 2020-11-26 20:31:22 +10:00
Alexey Tereshenkov
7764128044 Add lgtm.yml configuration file
Allow LGTM.com use the custom configuration to analyze C++ code of the project
2020-11-26 20:31:22 +10:00
Nigel Stewart
9fb23c3e61 Documentation updates for GLEW 2.2.0 release 2020-03-15 21:59:54 +10:00
Nigel Stewart
555aa3ffc0 Exclude GLU and GL_SGIX_color_type extensions 2020-03-15 21:52:24 +10:00
Jose Santiago
5ea705737a Link the UTILS to the static library if BUILD_SHARED_LIBS is disabled. 2020-03-06 07:54:09 +10:00