diff options
-rw-r--r-- | meson.build | 6 | ||||
-rw-r--r-- | src/meson.build | 63 |
2 files changed, 35 insertions, 34 deletions
diff --git a/meson.build b/meson.build index eb7e5cd..0f6dc71 100644 --- a/meson.build +++ b/meson.build @@ -231,12 +231,6 @@ if dl_dep.found() pkgconf.set('DLOPEN_LIBS', '-ldl') endif -configure_file(input: 'epoxy.pc.in', - output: 'epoxy.pc', - configuration: pkgconf, - install: true, - install_dir: join_paths(epoxy_libdir, 'pkgconfig')) - # Python python = import('python3').find_python() if not python.found() 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', +) |