build: modernize meson usage

Since we require meson 1.3(.2), we can modernize the usage a bit,
as well as improve some logic

- use / instead of join_paths
- use option.allowed() instead of !option.disable()
- use cxx.get_supported_arguments
- use fs.copyfile instead of configure_file
- show a summary at the end of the configuration
This commit is contained in:
Dirk-Jan C. Binnema
2026-08-02 10:14:17 +03:00
committed by Seth Ladygo
parent 04079aee7c
commit ac52584562
12 changed files with 114 additions and 85 deletions

View File

@ -1,4 +1,4 @@
## Copyright (C) 2021-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2021-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -92,6 +92,6 @@ list_maildirs = executable('list-maildirs', 'mu-scanner.cc',
dependencies: [glib_dep, config_h_dep,
lib_mu_utils_dep])
if not get_option('tests').disabled()
if get_option('tests').allowed()
subdir('tests')
endif

View File

@ -1,4 +1,4 @@
## Copyright (C) 2022-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2022-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -43,6 +43,6 @@ lib_mu_message_dep = declare_dependency(
include_directories:
include_directories(['.', '..']))
if not get_option('tests').disabled()
if get_option('tests').allowed()
subdir('tests')
endif

View File

@ -1,4 +1,4 @@
## Copyright (C) 2021-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2021-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -139,8 +139,8 @@ test('test-store-query',
#
# benchmarks
#
bench_maildirs=join_paths(meson.current_build_dir(), 'maildirs')
bench_store=join_paths(meson.current_build_dir(), 'store')
bench_maildirs=meson.current_build_dir() / 'maildirs'
bench_store=meson.current_build_dir() / 'store'
bench_indexer_exe = executable(
'bench-indexer',
'bench-indexer.cc',

View File

@ -1,4 +1,4 @@
## Copyright (C) 2022-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2022-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
thirdparty=join_paths('..', '..', 'thirdparty')
thirdparty='..' / '..' / 'thirdparty'
srcs = [
'mu-command-handler.cc',
@ -28,7 +28,7 @@ srcs = [
'mu-utils.cc',
]
if not get_option('tests').disabled()
if get_option('tests').allowed()
test_srcs = [ 'mu-test-utils.cc' ]
else
test_srcs = []
@ -62,6 +62,6 @@ html2text = executable('mu-html2text',
cpp_args: ['-DBUILD_HTML_TO_TEXT'],
install: false)
if not get_option('tests').disabled()
if get_option('tests').allowed()
subdir('tests')
endif