diff --git a/meson.build b/meson.build index a0c9554..df87110 100644 --- a/meson.build +++ b/meson.build @@ -102,6 +102,20 @@ x11_dep = dependency('x11', required: false) gles1_dep = cc.find_library('libGLESv1_CM', required: false) gles2_dep = cc.find_library('libGLESv2', required: false) +# On windows, the DLL has to have all of its functions +# resolved at link time, so we have to link directly aginst +# opengl32. But that's the only GL provider, anyway. +if host_system == 'windows' + opengl32_dep = cc.find_library('opengl32', required: true) + + # When building against static libraries, we need to control + # the order of the dependencies, and gdi32 provides symbols + # needed when using opengl32, like SetPixelFormat and + # ChoosePixelFormat. This is mostly a workaround for older + # versions of Meson. + gdi32_dep = cc.find_library('gdi32', required: true) +endif + # PkgConfig file pkgconf = configuration_data() pkgconf.set('prefix', epoxy_prefix) diff --git a/src/meson.build b/src/meson.build index c47a674..05d4f7b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -91,8 +91,7 @@ endif epoxy_deps = [ dl_dep, ] if host_system == 'windows' - ogl_dep = cc.find_library('opengl32', required: true) - epoxy_deps += [ ogl_dep, ] + epoxy_deps += [ opengl32_dep, gdi32_dep ] endif # Allow building a static version of epoxy