47 lines
1.2 KiB
Meson
47 lines
1.2 KiB
Meson
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
# Copyright © 2023 Thorsten Schubert <tschubert@bafh.org>
|
|
|
|
project('procwatch', 'cpp', version: files('meson.version'), default_options: ['cpp_std=c++23', 'warning_level=3'])
|
|
|
|
cc = meson.get_compiler('cpp')
|
|
cpp_args = []
|
|
|
|
if get_option('buildtype') == 'release'
|
|
cpp_args += [ '-Db_lto=true']
|
|
|
|
compiler_args = [
|
|
'-fmodulo-sched',
|
|
'-frecord-gcc-switches']
|
|
else
|
|
compiler_args = [
|
|
'-frecord-gcc-switches',
|
|
'-Wconversion',
|
|
'-Wno-unused-parameter',
|
|
'-Wno-unused-variable',
|
|
'-Weffc++']
|
|
endif
|
|
|
|
foreach arg : cpp_args
|
|
add_project_arguments(arg, language : 'cpp')
|
|
endforeach
|
|
|
|
foreach arg : compiler_args
|
|
if cc.has_argument(arg)
|
|
add_project_arguments(arg, language : 'cpp')
|
|
endif
|
|
endforeach
|
|
|
|
# subprojects / dependencies
|
|
deps = [ dependency('CLI11'), dependency('re2'), dependency('libnotify') ]
|
|
|
|
conf = configuration_data()
|
|
conf.set('PROJECT_VERSION', meson.project_version())
|
|
conf.set('BENCHMARK', get_option('bench'))
|
|
conf.set('NDEBUG', get_option('ndebug'))
|
|
|
|
configure_file(input: 'config.h.in', output: 'config.h', configuration: conf)
|
|
|
|
name = meson.project_name()
|
|
|
|
install_man(name + '.1')
|
|
executable(name, 'src/proc.cc', 'src/notify.cc', dependencies: deps, install: true)
|