diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-02-07 13:12:54 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-02-23 10:57:53 +0000 |
commit | b1119d8fcfe646f3ff108a3bf3685dfce6f049e4 (patch) | |
tree | 7a3ec8fb5f9340635134caf09c94e40d03e2f031 /src | |
parent | 0d6aaa20eafb4752dde873533a68c8ca05dec3fe (diff) | |
download | libepoxy-b1119d8fcfe646f3ff108a3bf3685dfce6f049e4.tar.gz |
meson: Generate the pkg-config file
Instead of using a template file, and filling in the blanks, we can use
the Meson pkgconfig module to generate the pkg-config file mostly from
the library object itself — including dependencies and flags.
The template file remains in tree for the Autotools build.
Diffstat (limited to 'src')
-rw-r--r-- | src/meson.build | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/src/meson.build b/src/meson.build index 2b38466..e54eed2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -67,31 +67,38 @@ if host_system == 'windows' epoxy_deps += [ opengl32_dep, gdi32_dep ] endif -# Allow building a static version of epoxy -if libtype != 'shared' - libepoxy_static = static_library('epoxy', - sources: epoxy_sources + epoxy_headers, - install: true, - dependencies: epoxy_deps, - include_directories: libepoxy_inc, - c_args: common_cflags + visibility_cflags, - link_args: common_ldflags) - libepoxy = libepoxy_static -endif - -if libtype != 'static' - libepoxy_shared = shared_library('epoxy', - sources: epoxy_sources + epoxy_headers, - version: '0.0.0', - install: true, - dependencies: epoxy_deps, - include_directories: libepoxy_inc, - c_args: common_cflags + visibility_cflags, - link_args: common_ldflags) - libepoxy = libepoxy_shared -endif - -libepoxy_dep = declare_dependency(link_with: libepoxy, - include_directories: libepoxy_inc, - dependencies: epoxy_deps, - sources: epoxy_headers) +libepoxy = library( + 'epoxy', + sources: epoxy_sources + epoxy_headers, + version: '0.0.0', + install: true, + dependencies: epoxy_deps, + include_directories: libepoxy_inc, + c_args: common_cflags + visibility_cflags, + link_args: common_ldflags, +) + +libepoxy_dep = declare_dependency( + link_with: libepoxy, + include_directories: libepoxy_inc, + dependencies: epoxy_deps, + sources: epoxy_headers, +) + +epoxy_has_glx = build_glx ? '1' : '0' +epoxy_has_egl = build_egl ? '1' : '0' +epoxy_has_wgl = build_wgl ? '1' : '0' + +pkg = import('pkgconfig') +pkg.generate( + libraries: libepoxy, + name: 'epoxy', + description: 'GL dispatch library', + version: meson.project_version(), + variables: [ + 'epoxy_has_glx=@0@'.format(epoxy_has_glx), + 'epoxy_has_egl=@0@'.format(epoxy_has_egl), + 'epoxy_has_wgl=@0@'.format(epoxy_has_wgl), + ], + filebase: 'epoxy', +) |