Skip to contentSkip to conversation

meson: add option to disable documentation

PATCH New [email protected] 1 participant 3 messages Aug 31, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 meson: add option to disable documentation

From: Ross Burton <[email protected]>

Building the documentation shouldn't be mandatory, as it needs asciidoc and xmlto. Add a "docs" option, defaulting to true, to control whether the documentation should be built.

---
 meson.build       | 15 +++++++++------
 meson_options.txt |  4 ++++
 2 files changed, 13 insertions(+), 6 deletions(-)
meson.build +9 -6
index b61c873..506b0e8 100644
@@ -45,10 +45,13 @@ if cunit_dep.found()
     subdir('utest')
 endif
 subdir('samples')
-subdir('Documentation')
 
-custom_target(
-    'docs',
-    output: 'docs',
-    depends: [html, man],
-    command: ['echo'])
+if get_option('docs')
+    subdir('Documentation')
+
+    custom_target(
+        'docs',
+        output: 'docs',
+        depends: [html, man],
+        command: ['echo'])
+endif
meson_options.txt +4 -0
index b2294f6..0611216 100644
@@ -4,6 +4,10 @@
 
 option('plugindir', type : 'string',
        description : 'set the plugin dir')
+
+option('docs', type : 'boolean', value: true,
+       description : 'build documentation')
+
 option('htmldir', type : 'string', value : 'share/doc/libtraceevent-doc',
        description : 'directory for HTML documentation')
 option('asciidoctor', type : 'boolean', value: false,
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/3 meson: build plugins as modules

From: Ross Burton <[email protected]>

Don't build the plugins with library() as that will install both static libraries and versioned shared libraries. Plugins are shared_modules().

---
 plugins/meson.build | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
plugins/meson.build +1 -2
index 74ad664..4919be4 100644
@@ -19,11 +19,10 @@ plugins = [
 
 pdeps = []
 foreach plugin : plugins
-    pdeps += library(
+    pdeps += shared_module(
         plugin.replace('.c', ''),
         plugin,
         name_prefix: '',
-        version: library_version,
         dependencies: [libtraceevent_dep],
         include_directories: [incdir],
         install: true,
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/3 meson: set the default plugindir to make Makefile

In reply to [email protected]

From: Ross Burton <[email protected]>

The Makefiles install the plugins to $libdir/traceevent/plugins, so make the Meson build files install to the same location.

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index 506b0e8..4bba4d8 100644
@@ -25,7 +25,7 @@ htmldir = join_paths(prefixdir, get_option('htmldir'))
 libdir = join_paths(prefixdir, get_option('libdir'))
 plugindir = get_option('plugindir')
 if plugindir == ''
-    plugindir = join_paths(libdir, 'libtraceevent/plugins')
+    plugindir = join_paths(libdir, 'traceevent/plugins')
 endif
 
 add_project_arguments(
Signature · 1 line
2.34.1