[libsoup/libsoup-2-74] meson: Use an gssapi as a proper dependency



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

    meson: Use an 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 |  3 ++-
 meson.build         | 12 +++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/libsoup/meson.build b/libsoup/meson.build
index 432e294d..e585b3fe 100644
--- a/libsoup/meson.build
+++ b/libsoup/meson.build
@@ -249,6 +249,7 @@ deps = [
   libpsl_dep,
   brotlidec_dep,
   platform_deps,
+  gssapi_dep,
   libz_dep,
 ]
 
@@ -275,7 +276,7 @@ pkg.generate(libsoup,
 libsoup_dep = declare_dependency(link_with : libsoup,
   include_directories : configinc,
   sources : soup_enum_h,
-  dependencies : [ platform_deps, glib_deps ])
+  dependencies : [ platform_deps, gssapi_dep, glib_deps ])
 
 if enable_gnome
   soup_gnome_api_name = 'soup-gnome-' + apiversion
diff --git a/meson.build b/meson.build
index eb52f877..4202342a 100644
--- a/meson.build
+++ b/meson.build
@@ -310,12 +310,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')
@@ -328,9 +327,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]