build: Explicitly link against gdi32

We need to explicitly link against gdi32 in order to access
SetPixelFormat and ChoosetPixelFormat, and the order of the linking is
relevant when using static libraries. This is a slight workaround to the
order of compiler arguments generated by Meson, and it's supposed to go
away in the near future.
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent bbcc3b4b81
commit ba2e7b151b
  1. 14
      meson.build
  2. 3
      src/meson.build

@ -102,6 +102,20 @@ x11_dep = dependency('x11', required: false)
gles1_dep = cc.find_library('libGLESv1_CM', required: false) gles1_dep = cc.find_library('libGLESv1_CM', required: false)
gles2_dep = cc.find_library('libGLESv2', 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 # PkgConfig file
pkgconf = configuration_data() pkgconf = configuration_data()
pkgconf.set('prefix', epoxy_prefix) pkgconf.set('prefix', epoxy_prefix)

@ -91,8 +91,7 @@ endif
epoxy_deps = [ dl_dep, ] epoxy_deps = [ dl_dep, ]
if host_system == 'windows' if host_system == 'windows'
ogl_dep = cc.find_library('opengl32', required: true) epoxy_deps += [ opengl32_dep, gdi32_dep ]
epoxy_deps += [ ogl_dep, ]
endif endif
# Allow building a static version of epoxy # Allow building a static version of epoxy

Loading…
Cancel
Save