[libsoup] meson: Use gssapi as a proper dependency



commit 6e126315ea6a6045d66dfcd512759b4bc02c8f72
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Sat Oct 9 16:16:19 2021 +0530

    meson: Use gssapi as a proper dependency
    
    There is no need to add it to the project arguments; we should treat
    it as any other dependency. There's nothing special about it.

 libsoup/meson.build |  5 +++--
 meson.build         | 12 +++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/libsoup/meson.build b/libsoup/meson.build
index 826477a1..6f17a440 100644
--- a/libsoup/meson.build
+++ b/libsoup/meson.build
@@ -184,6 +184,7 @@ deps = [
   libpsl_dep,
   brotlidec_dep,
   platform_deps,
+  gssapi_dep,
   libz_dep,
   libnghttp2_dep,
 ]
@@ -240,13 +241,13 @@ pkg.generate(libsoup,
 libsoup_dep = declare_dependency(link_with : libsoup,
   include_directories : libsoup_includes,
   sources : soup_enum_h,
-  dependencies : [ platform_deps, glib_deps ]
+  dependencies : [ platform_deps, gssapi_dep, glib_deps ]
 )
 
 libsoup_static_dep = declare_dependency(link_with : libsoup_static,
   include_directories : libsoup_includes,
   sources : soup_enum_h,
-  dependencies : [ platform_deps, glib_deps ]
+  dependencies : [ platform_deps, gssapi_dep, glib_deps ]
 )
 
 if enable_introspection or enable_vapi
diff --git a/meson.build b/meson.build
index 5a41b3be..0ab054c4 100644
--- a/meson.build
+++ b/meson.build
@@ -317,12 +317,11 @@ if cc.get_id() == 'msvc'
   else
     gssapi_lib_type = '64'
   endif
-  gssapi_lib = cc.find_library('gssapi' + gssapi_lib_type,
+  gssapi_dep = cc.find_library('gssapi' + gssapi_lib_type,
     has_headers: 'gssapi/gssapi.h',
     required: gssapi_opt)
-  if gssapi_lib.found()
+  if gssapi_dep.found()
       enable_gssapi = true
-      add_project_link_arguments('gssapi@0@.lib'.format(gssapi_lib_type), language : 'c')
   endif
 else
   krb5_config_path = get_option('krb5_config')
@@ -335,9 +334,12 @@ else
     cflags_output = run_command (krb5_config, '--cflags', 'gssapi', check: gssapi_opt.enabled())
     if libs_output.returncode() == 0 and cflags_output.returncode() == 0
       enable_gssapi = true
-      add_project_link_arguments(libs_output.stdout().split(), language : 'c')
-      add_project_arguments(cflags_output.stdout().split(), language : 'c')
+      gssapi_dep = declare_dependency(
+        link_args: libs_output.stdout().split(),
+        compile_args: cflags_output.stdout().split())
     endif
+  else
+    gssapi_dep = dependency('', required: false)
   endif
 endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]