skaslev / gl3w

Simple OpenGL core profile loading
http://github.com/skaslev/gl3w
The Unlicense
709 stars 160 forks source link

rudimentary cmake support #2

Closed SimonWallner closed 13 years ago

SimonWallner commented 13 years ago

hey skaslev,

I added rudymentary cmake support to build the lib. I don't habe much experience with cmake but it might be a good starting point for "official" cmake support.

all the best Simon

skaslev commented 13 years ago

Hey Simon,

Thanks for your contribution but gl3w uses a scons build system currently which is sufficient for the moment. I don't think the build system is that important for gl3w since it consists of only 3 generated files which most people are just going to statically link in their projects.

One place that gl3w needs some help is using it as dynamic library which currently works only on Linux. Windows support should be trivial but since I don't have access to a Windows machine currently I still haven't gotten to it. The needed changes could be something like that

#ifdef _WIN32
#define GL3W_IMPORT __declspec(dllimport)
#define GL3W_EXPORT __declspec(dllexport)
#else
#define GL3W_IMPORT
#define GL3W_EXPORT
#endif

#ifdef GL3W_BUILD
#define GL3W_API    GL3W_EXPORT
#else
#define GL3W_API    GL3W_IMPORT
#endif

and then mark all gl3w api functions with GL3W_API and have the build system define GL3W_BUILD when a dynamic library is being build.

Any help with that is deeply appreciated =-)

Cheers,

Slavi