diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | epoxy.pc.in | 1 | ||||
-rw-r--r-- | src/meson.build | 12 |
3 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 8a4ffea..045f920 100644 --- a/configure.ac +++ b/configure.ac @@ -227,6 +227,12 @@ fi AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes) PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no]) +PKG_CHECK_MODULES(EGL, [egl], [egl=yes], [egl=no]) + +GL_REQS="" +AS_IF([test x$gl = xyes], [GL_REQS="$GL_REQS gl"]) +AS_IF([test x$build_egl = xyes && test x$egl = xyes], [GL_REQS="$GL_REQS egl"]) +AC_SUBST(GL_REQS) # Variables for the pkg-config file; AC_SUBST does not do `test` substitutions, # so we need to specify the boolean values here diff --git a/epoxy.pc.in b/epoxy.pc.in index 7828a77..cdda8d9 100644 --- a/epoxy.pc.in +++ b/epoxy.pc.in @@ -13,3 +13,4 @@ Version: @PACKAGE_VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lepoxy Libs.private: @DLOPEN_LIBS@ +Requires.private: @GL_REQS@ diff --git a/src/meson.build b/src/meson.build index e54eed2..3401075 100644 --- a/src/meson.build +++ b/src/meson.build @@ -89,6 +89,17 @@ epoxy_has_glx = build_glx ? '1' : '0' epoxy_has_egl = build_egl ? '1' : '0' epoxy_has_wgl = build_wgl ? '1' : '0' +# We don't want to add these dependencies to the library, as they are +# not needed when building Epoxy; we do want to add them to the generated +# pkg-config file, for consumers of Epoxy +gl_reqs = [] +if gl_dep.found() + gl_reqs += 'gl' +endif +if build_egl and egl_dep.found() + gl_reqs += 'egl' +endif + pkg = import('pkgconfig') pkg.generate( libraries: libepoxy, @@ -101,4 +112,5 @@ pkg.generate( 'epoxy_has_wgl=@0@'.format(epoxy_has_wgl), ], filebase: 'epoxy', + requires_private: ' '.join(gl_reqs), ) |