diff options
| author | Yaron Cohen-Tal <yaronct@gmail.com> | 2015-07-18 12:00:06 +0300 |
|---|---|---|
| committer | Yaron Cohen-Tal <yaronct@gmail.com> | 2015-07-18 17:39:12 +0300 |
| commit | 773dd02f596b3f256bb1c0f65ac091db93a9518b (patch) | |
| tree | 16e4d3260145e7f515bb97f2ab965e61ce0c63bf /src | |
| parent | 8bbc0d40c6c4e023e71ac8bfe7f5898005cac920 (diff) | |
| download | libepoxy-773dd02f596b3f256bb1c0f65ac091db93a9518b.tar.gz | |
Added makefiles to build with MSVC 2013, and fixed errors and warnings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.sources | 46 | ||||
| -rw-r--r-- | src/Makefile.vc | 73 | ||||
| -rw-r--r-- | src/dispatch_common.h | 24 | ||||
| -rwxr-xr-x | src/gen_dispatch.py | 2 |
4 files changed, 132 insertions, 13 deletions
diff --git a/src/Makefile.sources b/src/Makefile.sources new file mode 100644 index 0000000..689b332 --- /dev/null +++ b/src/Makefile.sources @@ -0,0 +1,46 @@ +# Copyright © 2014 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +GL_GEN_HEADER = include/epoxy/gl_generated.h + +GLX_GEN_HEADER = include/epoxy/glx_generated.h + +WGL_GEN_HEADER = include/epoxy/wgl_generated.h + +EGL_GEN_HEADER = include/epoxy/egl_generated.h + +GENERATED_GL_SOURCE = gl_generated_dispatch.c + +GENERATED_GLX_SOURCE = glx_generated_dispatch.c + +GENERATED_WGL_SOURCE = wgl_generated_dispatch.c + +GENERATED_EGL_SOURCE = egl_generated_dispatch.c + +EPOXY_C_SRC = dispatch_common.c + +EPOXY_GLX_C_SRC = dispatch_glx.c + +EPOXY_WGL_C_SRC = dispatch_wgl.c + +EPOXY_EGL_C_SRC = dispatch_egl.c + +EPOXY_SRC_HDR = dispatch_common.h diff --git a/src/Makefile.vc b/src/Makefile.vc new file mode 100644 index 0000000..a111bab --- /dev/null +++ b/src/Makefile.vc @@ -0,0 +1,73 @@ +# Copyright © 2015 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Note: To build and use libepoxy for Visual Studio prior to Visual Studio 2013, +# you need to ensure that you have stdint.h, inttypes.h and stdbool.h +# that will work for your installation of Visual Studio, which can be +# found by the compiler. One possibility would be to use msinttypes +# and adapting gnulib's stdbool.h.in for your use. + +# Adjust this to where your Python interpretor resides in +PYTHONDIR=c:\python27 + +# Choose whether libtool-style DLL names are desired (set as 1) +LIBTOOL_DLL_NAMING = 0 + +# Please don't change the following lines +EPOXY_BASENAME = epoxy + +!if "$(LIBTOOL_DLL_NAMING)" == "1" +EPOXY_DLL_BASENAME = lib$(EPOXY_BASENAME)-0 +!else +EPOXY_DLL_BASENAME = $(EPOXY_BASENAME)-vs$(VSVER) +!endif + +!include ..\msvc\detectenv-msvc.mak +!include Makefile.sources + +all: $(EPOXY_DLL_BASENAME).dll + +$(EPOXY_DLL_BASENAME).dll: ../$(GL_GEN_HEADER) ../$(WGL_GEN_HEADER) ../$(EGL_GEN_HEADER) $(GENERATED_GL_SOURCE) $(GENERATED_WGL_SOURCE) $(GENERATED_EGL_SOURCE) $(EPOXY_C_SRC) $(EPOXY_WGL_C_SRC) $(EPOXY_EGL_C_SRC) + $(CC) $(CFLAGS_ADD) $(CFLAGS_C99_COMPAT) $(EPOXY_C_SRC) $(EPOXY_WGL_C_SRC) $(EPOXY_EGL_C_SRC) $(GENERATED_GL_SOURCE) $(GENERATED_WGL_SOURCE) $(GENERATED_EGL_SOURCE) /I c:\opt\Imagination-3_5\PowerVR_Graphics\PowerVR_SDK\SDK_3.5\Builds\Include \ + /link /DLL /DEBUG $(EXTRA_LDFLAGS) /pdb:$(EPOXY_DLL_BASENAME).pdb /out:$@ /implib:$(EPOXY_BASENAME).lib + @if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2 + +..\$(GL_GEN_HEADER) $(GENERATED_GL_SOURCE): gen_dispatch.py + $(PYTHONDIR)\python.exe gen_dispatch.py --dir .. ..\registry\gl.xml + +..\$(WGL_GEN_HEADER) $(GENERATED_WGL_SOURCE): gen_dispatch.py + $(PYTHONDIR)\python.exe gen_dispatch.py --dir .. ..\registry\wgl.xml + +..\$(EGL_GEN_HEADER) $(GENERATED_EGL_SOURCE): gen_dispatch.py + $(PYTHONDIR)\python.exe gen_dispatch.py --dir .. ..\registry\egl.xml + +clean: + @-del *.lib + @-del *.exp + @-del *.dll + @-if exist *.dll.manifest del *.dll.manifest + @-del *.ilk + @-del *.pdb + @-del *.obj + @-del ..\include\epoxy\*generated.h + @-del $(GENERATED_GL_SOURCE) + @-del $(GENERATED_WGL_SOURCE) + @-del $(GENERATED_EGL_SOURCE) diff --git a/src/dispatch_common.h b/src/dispatch_common.h index 676a4d5..161fe07 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -24,7 +24,7 @@ #include <stdbool.h> #ifdef _WIN32 -#define PLATFORM_HAS_EGL 0 +#define PLATFORM_HAS_EGL 1 #define PLATFORM_HAS_GLX 0 #define PLATFORM_HAS_WGL 1 #define EPOXY_IMPORTEXPORT __declspec(dllexport) @@ -45,17 +45,6 @@ #define EPOXY_IMPORTEXPORT #endif -#include "epoxy/gl.h" -#if PLATFORM_HAS_GLX -#include "epoxy/glx.h" -#endif -#if PLATFORM_HAS_EGL -#include "epoxy/egl.h" -#endif -#if PLATFORM_HAS_WGL -#include "epoxy/wgl.h" -#endif - #ifndef PUBLIC # ifdef _WIN32 # define PUBLIC __declspec(dllexport) @@ -66,6 +55,17 @@ # endif #endif +#if PLATFORM_HAS_WGL +#include "epoxy/wgl.h" +#endif +#include "epoxy/gl.h" +#if PLATFORM_HAS_GLX +#include "epoxy/glx.h" +#endif +#if PLATFORM_HAS_EGL +#include "epoxy/egl.h" +#endif + #if defined(__GNUC__) #define PACKED __attribute__((__packed__)) #else diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index 1644cbf..e8f55b8 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -606,7 +606,7 @@ class Generator(object): # # It also writes out the actual initialized global function # pointer. - if func.ret_type == 'void': + if func.ret_type == 'void' or func.ret_type=='VOID': self.outln('GEN_THUNKS({0}, ({1}), ({2}))'.format(func.wrapped_name, func.args_decl, func.args_list)) |
