mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2025-03-20 15:56:16 +00:00
Merge https://github.com/nigels-com/glew.git into master HEAD at Sat Oct 5 09:11:32 GMT 2019
This commit is contained in:
commit
59c63684ee
17
Makefile
17
Makefile
@ -89,6 +89,7 @@ all debug: glew.lib glew.bin
|
||||
|
||||
LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
|
||||
LIB.LIBS := $(GL_LDFLAGS)
|
||||
LIB.SHARED.DIR ?= lib
|
||||
|
||||
LIB.SRCS := src/glew.c
|
||||
LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
|
||||
@ -100,7 +101,7 @@ LIB.SOBJS := $(LIB.SOBJS:.c=.o)
|
||||
|
||||
glew.lib: glew.lib.shared glew.lib.static
|
||||
|
||||
glew.lib.shared: lib lib/$(LIB.SHARED) glew.pc
|
||||
glew.lib.shared: lib $(LIB.SHARED.DIR) $(LIB.SHARED.DIR)/$(LIB.SHARED) glew.pc
|
||||
glew.lib.static: lib lib/$(LIB.STATIC) glew.pc
|
||||
|
||||
.PHONY: glew.lib glew.lib.shared glew.lib.static
|
||||
@ -118,11 +119,11 @@ ifneq ($(STRIP),)
|
||||
$(STRIP) -x $@
|
||||
endif
|
||||
|
||||
lib/$(LIB.SHARED): $(LIB.SOBJS)
|
||||
$(LIB.SHARED.DIR)/$(LIB.SHARED): $(LIB.SOBJS)
|
||||
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
|
||||
ifneq ($(LN),)
|
||||
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
|
||||
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
|
||||
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.SONAME)
|
||||
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.DEVLNK)
|
||||
endif
|
||||
ifneq ($(STRIP),)
|
||||
$(STRIP) -x $@
|
||||
@ -178,13 +179,13 @@ endif
|
||||
bin:
|
||||
mkdir bin
|
||||
|
||||
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) lib/$(LIB.SHARED)
|
||||
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
||||
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
|
||||
ifneq ($(STRIP),)
|
||||
$(STRIP) -x $@
|
||||
endif
|
||||
|
||||
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) lib/$(LIB.SHARED)
|
||||
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
|
||||
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
|
||||
ifneq ($(STRIP),)
|
||||
$(STRIP) -x $@
|
||||
@ -209,9 +210,9 @@ install.lib: glew.lib
|
||||
# runtime
|
||||
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
|
||||
$(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)"
|
||||
$(INSTALL) -m 0755 lib/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/"
|
||||
$(INSTALL) -m 0755 $(LIB.SHARED.DIR)/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/"
|
||||
else
|
||||
$(INSTALL) -m 0644 lib/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/"
|
||||
$(INSTALL) -m 0644 $(LIB.SHARED.DIR)/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/"
|
||||
endif
|
||||
ifneq ($(LN),)
|
||||
$(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)"
|
||||
|
18
README.md
18
README.md
@ -27,18 +27,24 @@ Windows binaries for [32-bit and 64-bit](https://sourceforge.net/projects/glew/f
|
||||
|
||||
Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.
|
||||
|
||||
[glew-20190928.tgz](https://sourceforge.net/projects/glew/files/glew/snapshots/glew-20190928.tgz/download) *GLEW 2.2.0 RC2: New extensions, bug fixes*
|
||||
|
||||
[glew-20181010.tgz](https://sourceforge.net/projects/glew/files/glew/snapshots/glew-20181010.tgz/download) *GLEW 2.2.0 RC1: New extensions, bug fixes*
|
||||
|
||||
## Build
|
||||
|
||||
It is highly recommended to build from a tgz or zip release snapshot.
|
||||
The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac.
|
||||
The code generation is known to work on Windows using [MSYS2](https://www.msys2.org/).
|
||||
For most end-users of GLEW the official releases are the best choice, with first class support.
|
||||
|
||||
### Linux and Mac
|
||||
|
||||
#### Using GNU Make
|
||||
|
||||
GNU make is the primary build system for GLEW, historically.
|
||||
It includes targets for building the sources and headers, for maintenance purposes.
|
||||
|
||||
##### Install build tools
|
||||
|
||||
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev`
|
||||
@ -77,6 +83,10 @@ _Note: you may need to call `make` in the **auto** folder first_
|
||||
|
||||
#### Using cmake
|
||||
|
||||
The cmake build is mostly contributer maintained.
|
||||
Due to the multitude of use cases this is maintained on a _best effort_ basis.
|
||||
Pull requests are welcome.
|
||||
|
||||
*CMake 2.8.12 or higher is required.*
|
||||
|
||||
##### Install build tools
|
||||
@ -134,7 +144,7 @@ Available from [Msys2](http://msys2.github.io/) and/or [Mingw-w64](http://mingw-
|
||||
|
||||
Requirements: bash, make, gcc
|
||||
|
||||
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
|
||||
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
|
||||
$ make
|
||||
$ make install
|
||||
$ make install.all
|
||||
@ -181,10 +191,6 @@ download a pre-generated (unsupported) snapshot:
|
||||
|
||||
https://sourceforge.net/projects/glew/files/glew/snapshots/
|
||||
|
||||
Travis-built snapshots are also available:
|
||||
|
||||
https://glew.s3.amazonaws.com/index.html
|
||||
|
||||
## Authors
|
||||
|
||||
GLEW is currently maintained by [Nigel Stewart](https://github.com/nigels-com)
|
||||
@ -211,7 +217,7 @@ Be sure to mention platform and compiler toolchain details when filing
|
||||
a bug report. The output of `glewinfo` can be quite useful for discussion
|
||||
also.
|
||||
|
||||
Generally GLEW is released once a year, around the time of the Siggraph
|
||||
Generally GLEW is usually released once a year, around the time of the Siggraph
|
||||
computer graphics conference. If you're not using the current release
|
||||
version of GLEW, be sure to check if the issue or bug is fixed there.
|
||||
|
||||
|
@ -79,7 +79,6 @@ static GLenum GLEWAPIENTRY glewContextInit ()
|
||||
const GLubyte* s;
|
||||
GLuint dot;
|
||||
GLint major, minor;
|
||||
size_t n;
|
||||
|
||||
#ifdef _WIN32
|
||||
getString = glGetString;
|
||||
@ -130,8 +129,11 @@ static GLenum GLEWAPIENTRY glewContextInit ()
|
||||
GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
|
||||
}
|
||||
|
||||
for (n = 0; n < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++n)
|
||||
_glewExtensionString[n] = GL_FALSE;
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < sizeof(_glewExtensionString) / sizeof(_glewExtensionString[0]); ++i)
|
||||
_glewExtensionString[i] = GL_FALSE;
|
||||
}
|
||||
|
||||
if (GLEW_VERSION_3_0)
|
||||
{
|
||||
|
@ -121,6 +121,8 @@ if (MSVC)
|
||||
target_compile_options (glew_s PRIVATE -GS-)
|
||||
# remove stdlib dependency
|
||||
target_link_libraries (glew LINK_PRIVATE -nodefaultlib -noentry)
|
||||
target_link_libraries (glew LINK_PRIVATE libvcruntime.lib)
|
||||
target_link_libraries (glew LINK_PRIVATE msvcrt.lib )
|
||||
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
|
||||
elseif (WIN32 AND ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang")))
|
||||
# remove stdlib dependency on windows with GCC and Clang (for similar reasons
|
||||
|
@ -117,7 +117,7 @@
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<ImportLibrary>$(LIB_DIR)\$(Configuration)\$(PlatformName)\$(TargetName).lib</ImportLibrary>
|
||||
<BaseAddress>0x62AA0000</BaseAddress>
|
||||
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>opengl32.lib;libvcruntime.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions> /ignore:4089</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>
|
||||
</AdditionalLibraryDirectories>
|
||||
@ -157,7 +157,7 @@
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<ImportLibrary>$(LIB_DIR)\$(Configuration)\$(PlatformName)\$(TargetName).lib</ImportLibrary>
|
||||
<BaseAddress>0x62AA0000</BaseAddress>
|
||||
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>opengl32.lib;libvcruntime.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions> /ignore:4089</AdditionalOptions>
|
||||
<AdditionalLibraryDirectories>
|
||||
</AdditionalLibraryDirectories>
|
||||
|
@ -191,7 +191,8 @@
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>glew32s.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>glew32s.lib;opengl32.lib;libvcruntime.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalLibraryDirectories>$(LIB_DIR)\$(Configuration)\$(PlatformName)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@ -220,7 +221,8 @@
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>glew32s.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>glew32s.lib;opengl32.lib;libvcruntime.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalLibraryDirectories>$(LIB_DIR)\$(Configuration)\$(PlatformName)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
@ -190,7 +190,8 @@
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>glew32s.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>glew32s.lib;glu32.lib;opengl32.lib;libvcruntime.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalLibraryDirectories>$(LIB_DIR)\$(Configuration)\$(PlatformName)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@ -219,7 +220,8 @@
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>glew32s.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>glew32s.lib;glu32.lib;opengl32.lib;libvcruntime.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalLibraryDirectories>$(LIB_DIR)\$(Configuration)\$(PlatformName)\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
@ -23,7 +23,9 @@ LDFLAGS.GL = -lGL -lX11
|
||||
LDFLAGS.STATIC = -Wl,-Bstatic
|
||||
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
|
||||
NAME = GLEW
|
||||
WARN = -Wall -W
|
||||
WARN += -Wall -W
|
||||
WARN += -Wshadow
|
||||
WARN += -pedantic
|
||||
POPT = -O2
|
||||
CFLAGS.EXTRA += -fPIC
|
||||
CFLAGS.EXTRA += -Wcast-qual
|
||||
|
@ -7,13 +7,14 @@ CFLAGS.EXTRA += -D_WIN32
|
||||
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
|
||||
LDFLAGS.EXTRA =
|
||||
CFLAGS.EXTRA += -fno-builtin -fno-stack-protector
|
||||
LDFLAGS.EXTRA += -nostdlib
|
||||
LIBDIR = $(GLEW_DEST)/bin
|
||||
WARN = -Wall -W
|
||||
WARN += -Wall -W
|
||||
WARN += -Wno-cast-function-type
|
||||
POPT = -O2
|
||||
BIN.SUFFIX = .exe
|
||||
LIB.SONAME = lib$(NAME).dll
|
||||
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
|
||||
LIB.SHARED = $(NAME).dll
|
||||
LIB.SHARED.DIR = bin
|
||||
LIB.STATIC = lib$(NAME).a # the static lib will be broken
|
||||
LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
|
||||
|
@ -4,7 +4,7 @@
|
||||
** Copyright (C) Nate Robins, 1997
|
||||
** Michael Wimmer, 1999
|
||||
** Milan Ikits, 2002-2008
|
||||
** Nigel Stewart, 2008-2013
|
||||
** Nigel Stewart, 2008-2019
|
||||
**
|
||||
** visualinfo is a small utility that displays all available visuals,
|
||||
** aka. pixelformats, in an OpenGL system along with renderer version
|
||||
@ -592,7 +592,7 @@ VisualInfoGDI (GLContext* ctx)
|
||||
|| (drawableonly && !(pfd.dwFlags & PFD_DRAW_TO_WINDOW))) continue;
|
||||
fprintf(file, "Visual ID: %2d depth=%d class=%s\n", i, pfd.cDepthBits,
|
||||
pfd.cColorBits <= 8 ? "PseudoColor" : "TrueColor");
|
||||
fprintf(file, " bufferSize=%d level=%d renderType=%s doubleBuffer=%ld stereo=%ld\n", pfd.cColorBits, pfd.bReserved, pfd.iPixelType == PFD_TYPE_RGBA ? "rgba" : "ci", pfd.dwFlags & PFD_DOUBLEBUFFER, pfd.dwFlags & PFD_STEREO);
|
||||
fprintf(file, " bufferSize=%d level=%d renderType=%s doubleBuffer=%ld stereo=%ld\n", pfd.cColorBits, pfd.bReserved, pfd.iPixelType == PFD_TYPE_RGBA ? "rgba" : "ci", (long) (pfd.dwFlags & PFD_DOUBLEBUFFER), (long) (pfd.dwFlags & PFD_STEREO));
|
||||
fprintf(file, " generic=%d generic accelerated=%d\n", (pfd.dwFlags & PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT, (pfd.dwFlags & PFD_GENERIC_ACCELERATED) == PFD_GENERIC_ACCELERATED);
|
||||
fprintf(file, " rgba: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits, pfd.cAlphaBits);
|
||||
fprintf(file, " auxBuffers=%d depthSize=%d stencilSize=%d\n", pfd.cAuxBuffers, pfd.cDepthBits, pfd.cStencilBits);
|
||||
|
Loading…
Reference in New Issue
Block a user