This patch uses the recently added `--lib-path` parameter to pass the
`libnm`'s built directory, which allows the proper generation of the
files in meson.

For correctness, the `libnm` target has also been added as dependency
for both targets, even though there is an indirect dependency through
`libnm_gir` which also depends on `libnm`.

Best regards,
From 68c576aa2e31792a4cfb49932953af9ae7bbf3ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= <[email protected]>
Date: Thu, 14 Dec 2017 12:50:48 +0100
Subject: [PATCH 2/2] build: Fix targets generated by generate-settings-docs.py

generate-settings-docs.py script is used to generate the
`nm-settings-docs.xml` and `nm-property-docs.xml` files. However,
to generate these files properly, the path where `libnm` shared
library is built must be passed to the script.

This patch uses the recently added `--lib-path` parameter to
pass the `libnm`'s built directory, which allows the proper
generation of the files in meson.
---
 libnm/meson.build | 39 ++++-----------------------------------
 1 file changed, 4 insertions(+), 35 deletions(-)

diff --git a/libnm/meson.build b/libnm/meson.build
index 6abfaf580..3541832a5 100644
--- a/libnm/meson.build
+++ b/libnm/meson.build
@@ -259,9 +259,6 @@ if enable_introspection
     )
   endif
 
-  # FIXME: uses the following variables
-  # GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH};',
-  # LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH};',
   generate_setting_docs = join_paths(meson.current_source_dir(), 'generate-setting-docs.py')
 
   name = 'nm-property-docs.xml'
@@ -269,46 +266,18 @@ if enable_introspection
     name,
     input: libnm_gir[0],
     output: name,
-    command: [generate_setting_docs, '--gir', '@INPUT@', '--output', '@OUTPUT@']
+    command: [generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--output', '@OUTPUT@'],
+    depends: libnm
   )
 
-  # FIXME: the makefile command
-  '''
-  # When the python scripts loads libnm and the address sanitizers is
-  # enabled, we must LD_PRELOAD libasan otherwise it will complain that
-  # it was not loaded as initial library.
-    'nm-property-docs.xml: libnm/generate-setting-docs.py $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la
-    $(AM_V_GEN)',
-    export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH};',
-    export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH};',
-    $(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so);',
-    "$(PYTHON)"',
-    $(srcdir)/libnm/generate-setting-docs.py',
-      --gir $(builddir)/libnm/NM-1.0.gir',
-      --output $@
-  '''
-
   name = 'nm-settings-docs.xml'
   nm_settings_docs = custom_target(
     name,
     input: libnm_gir[0],
     output: name,
-    command: [generate_setting_docs, '--gir', '@INPUT@', '--overrides', nm_settings_docs_overrides, '--output', '@OUTPUT@']
+    command: [generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--overrides', nm_settings_docs_overrides, '--output', '@OUTPUT@'],
+    depends: libnm
   )
-
-  # FIXME: the makefile command
-  '''
-    'nm-settings-docs.xml: libnm/generate-setting-docs.py libnm/nm-settings-docs-overrides.xml $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la
-    $(AM_V_GEN)',
-    export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH};',
-    export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH};',
-    $(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so);',
-    "$(PYTHON)"',
-    $(srcdir)/libnm/generate-setting-docs.py',
-      --gir $(builddir)/libnm/NM-1.0.gir',
-      --overrides $(word 2,$^)',
-      --output $@
-  '''
 endif
 
 if enable_tests
-- 
2.15.1

_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to