project('glew', 'c')

gl = dependency('gl')
inc = include_directories('include')
c_args = ['-DGLEW_STATIC']
if host_machine.system() == 'emscripten'
   lib = static_library('glew', 'src/glew.c', include_directories: inc, c_args: c_args)
else
	lib = static_library('glew', 'src/glew.c', include_directories: inc, c_args: c_args, dependencies: gl)
endif

libglew_dep = declare_dependency(include_directories: inc, link_with: lib, compile_args: c_args)