aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-08-08 14:30:42 -0400
committerDavid Robillard <d@drobilla.net>2022-01-28 21:57:07 -0500
commit62a515492994a0320b1c45e87b4360adbf1ae9ba (patch)
tree4a12b44ded17f5a3d97e447449379c19dc1da53b
parent5aa146e1ce58d295b5f45446bbbbdbb30c8e557d (diff)
downloadserd-62a515492994a0320b1c45e87b4360adbf1ae9ba.tar.gz
serd-62a515492994a0320b1c45e87b4360adbf1ae9ba.tar.bz2
serd-62a515492994a0320b1c45e87b4360adbf1ae9ba.zip
Move serdi to tools subdirectory
This separates the command-line tool code from the library implementation.
-rw-r--r--meson.build19
-rw-r--r--meson_options.txt4
-rw-r--r--test/meson.build2
-rw-r--r--tools/console.c (renamed from src/console.c)0
-rw-r--r--tools/console.h (renamed from src/console.h)0
-rw-r--r--tools/meson.build13
-rw-r--r--tools/serdi.c (renamed from src/serdi.c)0
7 files changed, 20 insertions, 18 deletions
diff --git a/meson.build b/meson.build
index 8248f576..bddb7392 100644
--- a/meson.build
+++ b/meson.build
@@ -196,19 +196,8 @@ pkg.generate(
description: 'A lightweight library for working with RDF')
# Build serdi command line utility
-if get_option('utils')
-
- tool_link_args = []
- if get_option('static')
- tool_link_args += ['-static']
- endif
-
- serdi = executable('serdi',
- ['src/serdi.c', 'src/console.c'],
- c_args: c_warnings + platform_args + prog_args,
- link_args: tool_link_args,
- install: true,
- dependencies: serd_dep)
+if get_option('tools')
+ subdir('tools')
if not get_option('docs').disabled()
install_man('doc/serdi.1')
@@ -228,14 +217,14 @@ endif
if not meson.is_subproject() and meson.version().version_compare('>=0.53.0')
summary('Tests', get_option('tests'), bool_yn: true)
- summary('Utilities', get_option('utils'), bool_yn: true)
+ summary('Tools', get_option('tools'), bool_yn: true)
summary('Install prefix', get_option('prefix'))
summary('Headers', get_option('prefix') / get_option('includedir'))
summary('Libraries', get_option('prefix') / get_option('libdir'))
- if get_option('utils')
+ if get_option('tools')
summary('Executables', get_option('prefix') / get_option('bindir'))
summary('Man pages', get_option('prefix') / get_option('mandir'))
endif
diff --git a/meson_options.txt b/meson_options.txt
index 5d55e09c..4562d9de 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,8 +7,8 @@ option('strict', type: 'boolean', value: false, yield: true,
option('tests', type: 'boolean', value: true, yield: true,
description: 'Build tests')
-option('utils', type: 'boolean', value: true, yield: true,
- description: 'Build command line utilities')
+option('tools', type: 'boolean', value: true, yield: true,
+ description: 'Build command line tools')
option('static', type: 'boolean', value: false, yield: true,
description: 'Statically link executables')
diff --git a/test/meson.build b/test/meson.build
index 898062f0..2cf3f32c 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -50,7 +50,7 @@ if autoship.found()
test('autoship', autoship, args: ['test', serd_src_root], suite: 'data')
endif
-if get_option('utils')
+if is_variable('serdi')
if wrapper != ''
script_args = ['--wrapper', wrapper, '--serdi', serdi.full_path()]
diff --git a/src/console.c b/tools/console.c
index df1bc2ff..df1bc2ff 100644
--- a/src/console.c
+++ b/tools/console.c
diff --git a/src/console.h b/tools/console.h
index 31076b24..31076b24 100644
--- a/src/console.h
+++ b/tools/console.h
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 00000000..3054364a
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,13 @@
+tool_c_args = c_warnings + platform_args + prog_args
+tool_link_args = []
+
+if get_option('static')
+ tool_link_args += ['-static']
+endif
+
+serdi = executable('serdi',
+ ['serdi.c', 'console.c'],
+ c_args: tool_c_args,
+ link_args: tool_link_args,
+ install: true,
+ dependencies: serd_dep)
diff --git a/src/serdi.c b/tools/serdi.c
index 73a3f05c..73a3f05c 100644
--- a/src/serdi.c
+++ b/tools/serdi.c