GNOME Bugzilla – Bug 650020
Visual C++ 2008/2010 Project files to compile Cogl and Cogl-Pango
Last modified: 2011-11-25 15:56:19 UTC
(Sorry I posted this in Clutter under Cogl, as there is no standalone Cogl entry in BugZilla) I have managed to come up with a set of Visual C++ 2008/2010 project files to compile Cogl and Cogl-Pango, under 32-bit and x64 modes. I do understand they may need to be updated further as Cogl development goes on, but this is what I have for now--I will do the updates under the msvc-support branch as things progress, in http://git.gnome.org/browse/cogl/log/?h=msvc-support. So these are the items I changed and added: To allow git to pick up updates in the pre-configured config.h(.win32.in)--http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=63c022c46480408f0b20ddbd04da5a11976e653f Update autotools files to expand the project files (and filter files for VS2010, to ease maintenance) for Cogl and Cogl-Pango, added distribution items--http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=c4dd10063ec808d75101b4864266904efd026af0 Added pre-configured headers and symbols files needed for compilation--http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=bcd89e4d8253d73b6ac71369d359fab5a52c54ae The Visual C++ 2008/2010 project files themselves with README.txt to explain the process--http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=7ad9185af44f97880eb84df9b6f26cd26ebc2b4a and http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=e1b4896d50fbaff968c6df01607663bb9f0f186f
I have made updates to the Visual C++ support with the following items, due to changes in the past few weeks to the COGL code: -Update VS Support (13/05)-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=53c887962d08002aec0e5d1aa312ec103a59aca6 --This is to make up for missed symbols to generate the .def file and the cogl-deprecated.h file which needs to be copied -Update config.h.win32.in (30/05)-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=5566e5c637bf61a501904a5682cbc28e86e8c07a --this is to accommodate for HAVE_CAIRO (always defined here) and the definition of HAVE_GLES_EGL_H (undefined) -Update Visual C++ support-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=78482993f5053a7f9f80074e9979bba289df100c --adapt to changes brought about by Robert's (and perhaps others') commits: 07c0b9f89ffc64175befb9cf40a07f499169ed67, d1434d1c335755955c41df0366478986e81ad650, ce7c06dc039189f8d7ebe971864bf3d109fa6324, c328e0608ff7c92b39524dfd3efa3e858b7260e0, bf7653ac93e0797a1b3378f0259a00c730560b20 and df1915d95735f4d13489f955235f5e532161494a --Added info in cogl-defined.h.win32 for the GLES items (though they aren't used for Windows builds for now-this is for consistency reasons!) -List cogl-quaternion-private.h in sources list-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=149f9abfe985721036f7d1d952ecf194d5333fbf --ensure that cogl-quaternion-private.h is distributed as well -Update cogl-depth-state.c-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=d1decd2d1a0edd3b292f64bc03621dd3f2f40e56 --Make sure variables do not use names that conflict with items in windef.h by making some variable names like the ones used in cogl-depth-state.h -Update cogl/cogl-debug.h-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=ab6c010e05db9ec99469e0a3d187ef7e8b09909a --Make up for missed right parenthesis for compilation under non-GNU compilers -Update Visual C++ projects/properties...-http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=236503f69afde8c3a25b69eda9ce20c976e8c029 --Make predefined macros (CFLAGS) more consistent with the autotools builds, and restored the _WIN32_WINNT=0x0500 macro for COGL and COGL-Pango, which should fix problems in the 32-bit builds --Force export of _cogl_debug_flags from COGL as it is required bu COGL-Pango as COGL_ENABLE_DEBUG is defined for all builds Any feedback is appreciated. Thank you!
Moving all bugs assigned to the Cogl component of the Clutter product to be under the general component of the new Cogl product.
Hi, Another time for updates on the status of adding Visual C++ building support for COGL during the past few weeks... The crash in COGL had made me shy to post updates here (bug 650833)-but a workaround/wrapper was used to remedy that (http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=d82c50734b868b5e9931a6400ce9a55f88f6be72). Here goes the list (earliest first on each category, marked by ">", since my last comment on updates): >Fix cogl-debug.h regarding missing right parenthesis-http://git.gnome.org/browse/cogl/commit/?id=ab6c010e05db9ec99469e0a3d187ef7e8b09909a (this was probably fixed somewhere in master though) >Update/fix Visual C++ projects/properties for several occassions- http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=236503f69afde8c3a25b69eda9ce20c976e8c029 (make predefined macros more like the CFLAGS used by autotools build on Windows) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=2b7da6c1d9131f4c9018e64bbd111ed0c7cbcd81 (cleanups of Projects and property sheets, force export of _cogl_debug_flags in cogl/cogl-debug.h) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=b2db04cc16a43f66aca5cee192bc87b8394d7eb7 (linking to Cairo) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=73c5cb9994df6f8c3c2e914b1a730a335b0b6050 (Correct VS2010 property sheet macros) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=7ff360679ae8cbdb0bbefd84b5af15c1e2d19f54 (Cleanup of VS2010 projects, seperate intermediate output folders for each project) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=b450b01086243320dc4a3f5ae55c94f18d4164a1 (Correct EOL of various VS files) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=90c6ea323c109920372de1245bbb977b7a88151c (add projects to compile crate example) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=191d6f41f7071bf68cc1f1065f11d4576990d469 (adapt to cogl-pango calling the winsys headers and defining COGL_GL_LIBNAME="" as opengl32.lib is still linked to directly on Windows) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=0c4167db17e7a3f384003ea6a91fca613b601a22 (copy the cogl/cogl-win32-renderer.h as well) >Adapt to changes in code/API- http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=69ea00be41047d675e4dbacf96184f14a0e82bfd http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=80786631286f2f8175d9127b5c85bdb14b5f15ba http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=b65b7b54fe3cf6b37c000475ef3be1aeb203e4ea http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=646bec6338f99f7b383d21ec6779df1f00266fd6 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=9a4b6ce7974aac108b2d4fe8959a3bb872eefc13 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=ed71bdc1da0937e178e35837228e7cd91cea39f3 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=d057b61827d460ab77ddd0a3bb3fe4f5293ea8e6 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=3da1fa7716076b8bb6bcfabc1fd50af724fb2124 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=7bb6947bc948f92336f7475c2cea7e70c263fd45 >Ensure the stub winsys is not filtered out, as it is built for all COGL builds- http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=bea2c5dae2fbcc72203c26850969d0bf6ee0e635 >Deal with C99ism- http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=c09406ab6e95cb7b99ff7c3ec6be86a7f450cc8d (cogl/winsys/cogl-winsys-stub.c) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=bc917fd33c2a5735e0d45c0630c3d83669f7d312 (cogl/winsys/cogl-winsys-stub.c--again) >Fix file distribution (probably already fixed in master?) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=b70440a3d081139f760d87fc4120649896c65158 (cogl/cogl-winsys-stub-private.h) >Make config.h.win32.in consistent with the config.h.in template http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=c1feb54ef238edededf04e6926f34a35b1dd8e9b (added items for EGL-though EGL is not used on Windows here) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=ed34aea43a1f153e190c4c8c7e745687d091c0a2 (added items to link OpenGL directly on Windows, as it is the case here) >Other fixes in the code http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=66713781b3473b2309acc74fa108281dbcdcf8c3 (cogl/winsys/cogl-winsys-wgl.c, regarding vtable.id) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=a2ae2b2a347426832dfe0d876d52d6d933ccbcf6 (cogl/cogl-renderer.c-regarding check macros--but I am wondering between the check macros as both are being used in the code) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=58462eb7b0bef239e57a3da1aca1dd6d7eee7b9a (cogl/Makefile.am-filter xlib code as well) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=82b4130dbbea9bfcf714e397516d9503c108ab9c (cogl/cogl-framebuffer.h, #define cogl_framebuffer_get_blue_bits cogl_framebuffer_get_blue_bits_EXP -> #define cogl_framebuffer_get_alpha_bits cogl_framebuffer_get_alpha_bits_EXP) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=ec6af0e2f6bdc0318f077379f98c0c73c7277c85 (cogl-defines.h.win32:Define COGL_HAS_WIN32_SUPPORT, as done in the autotools build) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=a0be7baecd4da382cd4aa926bac0d5ee428279f1(this may be iffy-see http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=a2ae2b2a347426832dfe0d876d52d6d933ccbcf6 as well) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=d1e234d38977092f0e60e439f367006978ecda1d (Include cogl-win32-renderer.h in cogl.h on Windows) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=8f8b43dbb3dc55052f90b6d1e1e3ca4f4de5a13e (bug 650833 fixes) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=c02274809a9c88f6dd7d113c03a3dfb5a019d300 (bug 650833 fixes update) Thank you for watching-sorry for the long post. God Bless.
I have some notes on some of the commits: * a2ae2b2a347426832dfe0d876d52d6d933ccbcf6 * Update cogl-renderer.c regarding check macros I don't think this is right. We should be defining both defines (COGL_HAS_WIN32_SUPPORT *and* COGL_HAS_WGL_SUPPORT). The first define is used to say we support the generic Windows API and the second define is used to say we support the WGL winsys. Although extremely unlikely, it's conceptually possible that one day we'd support some other winsys even on Windows, such as EGL or something. The configure script already has an AC_DEFINE for COGL_HAS_WGL_SUPPORT so this already works when building with autotools. I've pushed the following commits to master: * 66713781b3473b2309acc74fa108281dbcdcf8c3 * Update vtable.id in cogl-winsys-wgl.c * 82b4130dbbea9bfcf714e397516d9503c108ab9c * Fix cogl/cogl-framebuffer.h (#define error) * d1e234d38977092f0e60e439f367006978ecda1d * Include cogl-win32-renderer.h in cogl.h on Windows Thanks
(In reply to comment #4) > I have some notes on some of the commits: > > * a2ae2b2a347426832dfe0d876d52d6d933ccbcf6 > * Update cogl-renderer.c regarding check macros > > I don't think this is right. We should be defining both defines > (COGL_HAS_WIN32_SUPPORT *and* COGL_HAS_WGL_SUPPORT). The first define > is used to say we support the generic Windows API and the second > define is used to say we support the WGL winsys. Although extremely > unlikely, it's conceptually possible that one day we'd support some > other winsys even on Windows, such as EGL or something. The configure > script already has an AC_DEFINE for COGL_HAS_WGL_SUPPORT so this > already works when building with autotools. > Hi Neil, Thanks for the notes... I did realize that both COGL_HAS_WIN32_SUPPORT and COGL_HAS_WGL_SUPPORT macros would be needed, especially as I read in the COGL roadmap (or somewhere) that it is on the wishlist (or so) that other Windows winsys might be supported, such as D3D (hence the "iffy" clause in the comments above)... As a result, I did, switch the code back to its original state regarding COGL_HAS_WIN32_SUPPORT and COGL_HAS_WGL_SUPPORT in the msvc-support branch (please see commit cdd1554a12f41f255e0db8f0f53c75dfa1ec7a2d in that branch) few days ago. Sorry for not keeping the comments here more up-to-date for this. Hope this clears things up a bit. Thank you! God bless.
Hi, Time for another set of updates on the progress of MSVC compilation support for COGL... Here goes a list of changes since my last update here (please see comment #3) -Deal with C99ism in cogl/winsys/cogl-winsys-stub.c. This is now done in a way similar to what is now being done in cogl/winsys/cogl-winsys-wgl.c, as cogl/winsys/cogl-winsys-stub.c is built for all COGL builds (this is done in conjunction with a merge into msvc-support from master) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=958038751f108463cd9d4237b1093a41a908af3b -Generate the cogl/cogl-enum-types.c and cogl/cogl-enum-types.h via the property sheets again when compiling the COGL library, as cogl/cogl-win32-renderer.h must also be in the listing of files for glib-mkenums to parse. The cogl/cogl-enum-types.c and cogl/cogl-enum-types.h is now not distributed as a result. http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=9561cd626fd463331acc254ecf9ff5257ac97402 -Adapted to changes to the COGL API (addition/removal to/from cogl.symbols): http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=17690fc2a7e7e3c99be2fc95eda254e128b4a0c8 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=2711e8f8a2f2fc3c2e723f7a266e89d83e27071a -Revert usage of COGL_HAS_WIN32_SUPPORT to COGL_HAS_WGL_SUPPORT in cogl/cogl-defines.h.win32 cogl/cogl-renderer.c cogl/cogl.h config.h.win32.in Thanks to Neil for pointing out this part specifically in comment #4. http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=cdd1554a12f41f255e0db8f0f53c75dfa1ec7a2d -Update cogl/cogl.h in a way that the COGL_HAS_WIN32_SUPPORT is checked in a consistent way (i.e. #if COGL_HAS_WIN32_SUPPORT -> #if defined (COGL_HAS_WIN32_SUPPORT))--(this is done in conjunction with a merge into msvc-support from master) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=c5cf8e3890934e2c3c6a657d5f779e22cef34b94 -Define COGL_HAS_WIN32_SUPPORT in cogl/cogl-defines.h.win32 as well as that macro is used to determine whether to include cogl/cogl-win32-renderer.h in cogl/cogl.h for programs/libraries that make use of COGL. http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=fdba48a57c4be371383358be51b61d87cc752166 -Update VS property sheets in regards to cogl/cogl-display.h.in-copy that file directly to cogl/cogl-display.h (if cogl/cogl-display.h does not exist) as EGL/GDL is not relevant on Windows at least for now. http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=0506361980156cbe83e477859f5edbefe7934943 -Add cogl/cogl-display.h.in to list of files to distribute http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=7fb75e2c32c1a4d1cf4b10cf34ca38a6fdec78f9 http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=631f6ac7f4e9c7259e3a8c553b1eb0478daaaaf4 Thanks for watching! God bless.
Oh, By the way, the msvc-support branch also contains the fix regarding bug 655510 (cogl-winsys-wgl: Add a fallback for failed wglGetProcAddress) from Neil. http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=a8618c21e069f7b81f4b09e1c17aa05fe7268e96 The resulting tarball has been distchecked successfully on my Fedora 15 system. Thanks!
Hi, Time for some updates on the progress here (since Aug 01, 2011, earliest to latest for each group): -Update VS property sheets as cogl/cogl-display.h is no longer generated from cogl/cogl-display.h.in http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=d4b5b60894864ef9ddd94516df5b63997ca018d2 -Stop distribution of cogl/cogl-display.h.in as it is no longer used http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=32d6206a50977cd2ae84608fd109715eaa6204b2 -Update cogl.symbols due to the following commits: *64b2bbab84c3ded02c3852157e6a33166f9bc00a (framebuffer: Adds a context getter for CoglFramebuffer) *a3ad808f57f1ce4535b885c81a64a0934e859a36 (framebuffer: Make framebuffer_clear APIs public experimental) *f37d9bbb4d2a4c53910052f184b9867be846c7ec (matrix: Add cogl_matrix_look_at) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=61c3edf0e5adf7f84ef575b2039f25f35d69daa1 Thank you, and God bless!
Hi, Another time for updates on the progress here, since Aug 18, 2011... -Update VS README.txt regarding the COGL compilation instructions in GNOME Live! http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=54b0549e3b1a8dc830e6fdc5f99696bb863bef1c -Update cogl.symbols due to the following commits: *6584c183 (context: Add an accessor to get display associated with the context) *6a2e2118 (display: Add an accessor to get the renderer out of a display) *c36652a4 (renderer: Add cogl_renderer_get_n_fragment_texture_units()) -191d9156 (framebuffer: Add a getter for the framebuffer format) http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=6f61bbb38a77782d29413eadaa35bffc3d232028 -Update cogl.symbols again due to typo in cogl/cogl-display.h (please see bug 658333: cogl_display_get_rendrer_EXP ->cogl_display_get_renderer_EXP) Thank you, and God bless!
Hi, Another time for updates on the progress here, since Sept.6, 2011... -Update VS property sheets: "Install" the new COGL2 experimental header cogl\cogl2-experimental.h http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=cce6aadf9290b566d9cd40906535af60b7ee1c94 -Source change reverts (thanks to Neil for pointing out this part): cogl/cogl-depth-state.c: Revert "Do not use "near" and "far" variables" http://git.gnome.org/browse/cogl/commit/?h=msvc-support&id=ddad699a3a83b881ef9c6c1baba5943a922cb29e Note that I ended up keeping cogl-winsys-stub.c that is C99ism-free and kept it within the build as _cogl_winsys_stub_get_vtable is referred to by cogl/cogl-context.c unconditionally (unless that reference in cogl/cogl-context.c is guarded off by #ifndef COGL_HAS_WIN32_SUPPORT/#endif, but this will affect MinGW builds). Thank you, and God bless!
Hi, Can I know how is the review process going? Or maybe there are some places where things can be improved at this point? By the way, to keep people informed-the Visual C++ builds build the conformance tests, and they do pass without a hitch. Thanks for the time, and God bless!
Created attachment 201997 [details] [review] VS 2008/2010 project files to build Cogl I've landed the patch to avoid C99isms in cogl-winsys-stub with some changes so that it initialises the structure in a function like the WGL backend does. Otherwise it's not robust against people adding functions to the structure. I think the rest of the patches that touch Cogl code have already landed in Cogl master. I think it would therefore be good to squash the branch into a single patch because there is a lot of confusing reverts and reverts of reverts otherwise. I'm attaching the squashed patch which I'm happy to land if you agree. In commit 2b7da6c it was modifying _cogl_debug_flags to have the dllexport attribute. Is there a good reason for this? _cogl_debug_flags is an internal symbol so I don't think it should be exported from the DLL. I've removed these changes from the squashed patch. I've also modified the parts that are generating the .bat files for the conformance tests so that they are stored in $(top_builddir)/… instead of $(top_srcdir)/…. Otherwise it breaks make distcheck because the build should not be writing to the source directory.
Hi Neil (In reply to comment #12), Thanks for the time for dealing with this part. Basically I agree with the merged patchset, although I have a few notes I would like to mention, as follows: > I've landed the patch to avoid C99isms in cogl-winsys-stub with some > changes so that it initialises the structure in a function like the > WGL backend does I agree really with this-I tried to do this also in commit 7e592aed. > I think it would therefore be good to squash > the branch into a single patch because there is a lot of confusing > reverts and reverts of reverts otherwise. Thank you! (Sorry about the repeated reverts as they had to come as I was attempting to follow master development as close as possible) I believe the patch for bug 650833 needs to go in here as well, due to the bug in modff on 32-bit (x86) compilation in Visual Studio. Otherwise I think the other patches should have gone in by now (I believe that is not in master as that has something to do with Visual C++ support specifically). > In commit 2b7da6c it was modifying _cogl_debug_flags to have the > dllexport attribute. Is there a good reason for this? That dllexport attribute was placed there as cogl-pango-render.c referred to that internal variable indirectly, and linker errors are caused as a result unless _cogl_debug_flags was exported. But since _cogl_debug_flags is a variable, it had to be exported via the dllexport attribute, not through the cogl.symbols (i.e. def) file when COGL_ENABLE_DEBUG is turned on. I would rather not have done this dllexport thing if this was not the case though :) > I've also modified the parts that are generating the .bat files for > the conformance tests so that they are stored in $(top_builddir)/… > instead of $(top_srcdir)/…. Otherwise it breaks make distcheck because > the build should not be writing to the source directory. Sure, thank you! Especially as I am not that good in autotools :) God bless!
Created attachment 202066 [details] [review] cogl-debug: Mark _cogl_debug_flags with dllexport for MSVC (In reply to comment #13) > I believe the patch for bug 650833 needs to go in here as well, due > to the bug in modff on 32-bit (x86) compilation in Visual Studio. > Otherwise I think the other patches should have gone in by now (I > believe that is not in master as that has something to do with > Visual C++ support specifically). As far as I can tell, Cogl isn't using modff anywhere anymore since patch 1d8fd64e1cd7 so we don't need to worry about this anymore. > That dllexport attribute was placed there as cogl-pango-render.c referred to > that internal variable indirectly, and linker errors are caused as a result > unless _cogl_debug_flags was exported. Ah right, yes, I forgot about cogl-pango. Ok let's put that change back in as a separate patch (attached).
Review of attachment 202066 [details] [review]: I think this will do better than my version as it would not mislead people from using that variable publicly. Thanks, and God bless!
Ok, I've pushed both patches so I guess that means we can close this bug. Many thanks for all the hard work you've done for this and thanks for being patient with the review.
Thanks for the time for the review process and the suggestions that were involved! God Bless!