diff options
author | David Robillard <d@drobilla.net> | 2023-09-02 17:29:20 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-09-22 23:54:50 -0400 |
commit | 6c632697fe1ea1255311bb3a0e56574766d182c7 (patch) | |
tree | f48047b2df31b1e038e4a5f21fd49021952c80d7 | |
parent | 7c164613bf0e5d4a548830267b44a7241ac41c5e (diff) | |
download | serd-6c632697fe1ea1255311bb3a0e56574766d182c7.tar.gz serd-6c632697fe1ea1255311bb3a0e56574766d182c7.tar.bz2 serd-6c632697fe1ea1255311bb3a0e56574766d182c7.zip |
Clean up meson formatting
Formatted automatically with muon, with some manual changes to make things
format more nicely.
-rw-r--r-- | doc/meson.build | 3 | ||||
-rw-r--r-- | meson.build | 52 | ||||
-rw-r--r-- | test/meson.build | 108 |
3 files changed, 102 insertions, 61 deletions
diff --git a/doc/meson.build b/doc/meson.build index 0a706dc2..e1e2b918 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -33,7 +33,8 @@ if build_docs # Warn if the "official" theme isn't present pymod = import('python') doc_modules = ['sphinx_lv2_theme'] - if not pymod.find_installation('python3', modules: doc_modules, required: false).found() + py = pymod.find_installation('python3', modules: doc_modules, required: false) + if not py.found() warning('Missing sphinx_lv2_theme module, falling back to alabaster') endif diff --git a/meson.build b/meson.build index a9fa5643..f50c8f52 100644 --- a/meson.build +++ b/meson.build @@ -70,28 +70,30 @@ else # Only use the features detected by the build system platform_c_args += ['-DSERD_NO_DEFAULT_CONFIG'] + system_c_args - # Define HAVE_SOMETHING symbols for all detected features + # Feature checks have a header to include and code for the body of main() template = '#include <@0@>\nint main(void) { @1@; }' - if cc.links( - template.format('stdio.h', 'return fileno(stdin);'), - args: system_c_args, - name: 'fileno') - platform_c_args += ['-DHAVE_FILENO'] - endif - if cc.links( - template.format('fcntl.h', - 'posix_fadvise(0, 0, 4096, POSIX_FADV_SEQUENTIAL)'), - args: system_c_args, - name: 'posix_fadvise') - platform_c_args += ['-DHAVE_POSIX_FADVISE'] - endif - if cc.links( - template.format('stdlib.h', - 'void* mem=NULL; posix_memalign(&mem, 8U, 8U);'), - args: system_c_args, - name: 'posix_memalign') - platform_c_args += ['-DHAVE_POSIX_MEMALIGN'] - endif + feature_tests = { + 'fileno': [ + 'stdio.h', + 'return fileno(stdin);', + ], + 'posix_fadvise': [ + 'fcntl.h', + 'posix_fadvise(0, 0, 4096, POSIX_FADV_SEQUENTIAL);', + ], + 'posix_memalign': [ + 'stdlib.h', + 'void* mem=NULL; posix_memalign(&mem, 8U, 8U);', + ], + } + + # Define HAVE_SOMETHING symbols for all detected features + foreach name, args : feature_tests + code = template.format(args[0], args[1]) + if cc.links(code, args: system_c_args, name: name) + platform_c_args += ['-DHAVE_' + name.to_upper()] + endif + endforeach endif ########### @@ -199,9 +201,9 @@ if not meson.is_subproject() summary( { - 'Install prefix': get_option('prefix'), - 'Headers': get_option('prefix') / get_option('includedir'), - 'Libraries': get_option('prefix') / get_option('libdir'), + 'Install prefix': get_option('prefix'), + 'Headers': get_option('prefix') / get_option('includedir'), + 'Libraries': get_option('prefix') / get_option('libdir'), }, section: 'Directories', ) @@ -221,7 +223,6 @@ endif ########### ttl_metadata_files = files( - 'serd.ttl', 'test/extra/abbreviate/manifest.ttl', 'test/extra/bad/manifest.ttl', 'test/extra/big/manifest.ttl', @@ -232,6 +233,7 @@ ttl_metadata_files = files( 'test/extra/pretty/manifest.ttl', 'test/extra/qualify/manifest.ttl', 'test/extra/root/manifest.ttl', + 'serd.ttl', ) subdir('scripts') diff --git a/test/meson.build b/test/meson.build index cb98649e..9662f9f3 100644 --- a/test/meson.build +++ b/test/meson.build @@ -14,8 +14,8 @@ plot_scripts = files( simple_scripts = files( '../scripts/check_formatting.py', - 'run_suite.py', 'serd_test_util/__init__.py', + 'run_suite.py', 'test_quiet.py', 'test_stdin.py', 'test_write_error.py', @@ -232,84 +232,122 @@ ns_w3 = 'http://www.w3.org/2013/' test_suites = { 'nquads': [ - files('w3c/nquads/manifest.ttl'), ns_w3 + 'NQuadsTests/', - '--', '-a', '-i', 'NQuads', + files('w3c/nquads/manifest.ttl'), + ns_w3 + 'NQuadsTests/', + '--', + '-a', + ['-i', 'NQuads'], ], 'ntriples': [ - files('w3c/ntriples/manifest.ttl'), ns_w3 + 'NTriplesTests/', - '--', '-a', '-i', 'NTriples', + files('w3c/ntriples/manifest.ttl'), + ns_w3 + 'NTriplesTests/', + '--', + '-a', + ['-i', 'NTriples'], ], 'trig': [ - files('w3c/trig/manifest.ttl'), ns_w3 + 'TriGTests/', - '--', '-a', '-i', 'TriG', + files('w3c/trig/manifest.ttl'), + ns_w3 + 'TriGTests/', + '--', + '-a', + ['-i', 'TriG'], ], 'turtle': [ - files('w3c/turtle/manifest.ttl'), ns_w3 + 'TurtleTests/', - '--', '-a', '-i', 'Turtle', + files('w3c/turtle/manifest.ttl'), + ns_w3 + 'TurtleTests/', + '--', + '-a', + ['-i', 'Turtle'], ], 'abbreviate': [ - files('extra/abbreviate/manifest.ttl'), ns_serdtest + 'abbreviate/', + files('extra/abbreviate/manifest.ttl'), + ns_serdtest + 'abbreviate/', ], 'bad': [ - files('extra/bad/manifest.ttl'), ns_serdtest + 'bad/', + files('extra/bad/manifest.ttl'), + ns_serdtest + 'bad/', ], 'bad_turtle': [ - files('extra/bad/manifest.ttl'), ns_serdtest + 'bad/', - '--', '-o', 'turtle', + files('extra/bad/manifest.ttl'), + ns_serdtest + 'bad/', + '--', + ['-o', 'turtle'], ], 'big': [ - files('extra/big/manifest.ttl'), ns_serdtest + 'big/', + files('extra/big/manifest.ttl'), + ns_serdtest + 'big/', ], 'bulk': [ - files('extra/good/manifest.ttl'), ns_serdtest + 'good/', - '--', '-b', + files('extra/good/manifest.ttl'), + ns_serdtest + 'good/', + '--', + '-b', ], 'fast': [ - files('extra/good/manifest.ttl'), ns_serdtest + 'good/', - '--', '-f', + files('extra/good/manifest.ttl'), + ns_serdtest + 'good/', + '--', + '-f', ], 'full': [ - files('extra/full/manifest.ttl'), ns_serdtest + 'full/', - '--', '-f', + files('extra/full/manifest.ttl'), + ns_serdtest + 'full/', + '--', + '-f', ], 'good': [ - files('extra/good/manifest.ttl'), ns_serdtest + 'good/', + files('extra/good/manifest.ttl'), + ns_serdtest + 'good/', ], 'lax_lax': [ '--lax', - files('extra/lax/manifest.ttl'), ns_serdtest + 'lax/', - '--', '-l', + files('extra/lax/manifest.ttl'), + ns_serdtest + 'lax/', + '--', + '-l', ], 'lax_strict': [ - files('extra/lax/manifest.ttl'), ns_serdtest + 'lax/', + files('extra/lax/manifest.ttl'), + ns_serdtest + 'lax/', ], 'perfect_forward': [ - files('extra/perfect/manifest.ttl'), ns_serdtest + 'perfect/', + files('extra/perfect/manifest.ttl'), + ns_serdtest + 'perfect/', ], 'perfect_reverse': [ '--reverse', - files('extra/perfect/manifest.ttl'), ns_serdtest + 'perfect/', + files('extra/perfect/manifest.ttl'), + ns_serdtest + 'perfect/', ], 'prefix_add': [ '--reverse', - files('extra/prefix/manifest.ttl'), ns_serdtest + 'prefix/', - '--', '-p', 'test', + files('extra/prefix/manifest.ttl'), + ns_serdtest + 'prefix/', + '--', + ['-p', 'test'], ], 'prefix_remove': [ - files('extra/prefix/manifest.ttl'), ns_serdtest + 'prefix/', - '--', '-c', 'test', + files('extra/prefix/manifest.ttl'), + ns_serdtest + 'prefix/', + '--', + ['-c', 'test'], ], 'pretty': [ - files('extra/pretty/manifest.ttl'), ns_serdtest + 'pretty/', + files('extra/pretty/manifest.ttl'), + ns_serdtest + 'pretty/', ], 'qualify': [ - files('extra/qualify/manifest.ttl'), ns_serdtest + 'qualify/', - '--', '-i', 'turtle', # Just for coverage + files('extra/qualify/manifest.ttl'), + ns_serdtest + 'qualify/', + '--', + ['-i', 'turtle'], # Just for coverage ], 'root': [ - files('extra/root/manifest.ttl'), ns_serdtest + 'root/', - '--', '-r', 'http://example.org/top/root/', + files('extra/root/manifest.ttl'), + ns_serdtest + 'root/', + '--', + ['-r', 'http://example.org/top/root/'], ], } |