89 lines
2.5 KiB
Meson
89 lines
2.5 KiB
Meson
# Copyright (C) 2026 wanp
|
|
#
|
|
# This file is part of Wavy.
|
|
#
|
|
# Wavy is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Wavy is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with Wavy. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
project('Wavy', 'c',
|
|
version: '0',
|
|
license: 'GPL-3.0-or-later',
|
|
license_files: ['COPYING'],
|
|
default_options: {
|
|
'c_std': 'c99',
|
|
'warning_level': '2',
|
|
})
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
if get_option('single_process')
|
|
args = ['-D_XOPEN_SOURCE=500']
|
|
single_process = cc.has_function('open', args: args,
|
|
prefix: '#include <fcntl.h>')
|
|
single_process = single_process and cc.has_function(
|
|
'close', args: args,
|
|
prefix: '#include <unistd.h>')
|
|
single_process = single_process and cc.has_function(
|
|
'remove', args: args,
|
|
prefix: '#include <stdio.h>')
|
|
single_process = single_process and cc.has_function(
|
|
'lockf', args: args,
|
|
prefix: '#include <unistd.h>')
|
|
endif
|
|
|
|
src = [
|
|
'src/main.c',
|
|
'src/mem.c',
|
|
'src/files.c',
|
|
'src/app.c',
|
|
'src/popup.c',
|
|
'src/playback.c',
|
|
'src/flac.c',
|
|
'src/mp3.c',
|
|
'src/widgets.c',
|
|
]
|
|
|
|
compile_flags = [
|
|
'-DAPP_DEV_ID="wanp"',
|
|
'-DAPP_ID="com.wanpnet.wavy"',
|
|
'-DAPP_NAME="Wavy"',
|
|
'-DAPP_VERSION="' + meson.project_version() + '"',
|
|
'-DDATA_DIR="' + get_option('datadir') / 'wavy' + '"',
|
|
]
|
|
|
|
if single_process
|
|
compile_flags += '-DSINGLE_PROCESS'
|
|
endif
|
|
|
|
|
|
m_dep = cc.find_library('m', required: false)
|
|
sdl3_dep = dependency('sdl3', version: '>=3.4.0')
|
|
flac_dep = dependency('flac')
|
|
libmpg123_dep = dependency('libmpg123')
|
|
|
|
libtags_proj = subproject('libtags')
|
|
libtags_inc = 'subprojects/libtags'
|
|
libtags_dep = libtags_proj.get_variable('libtags')
|
|
|
|
|
|
executable('wavy',
|
|
sources: src,
|
|
c_args: compile_flags,
|
|
install: true,
|
|
win_subsystem: 'windows',
|
|
include_directories: [libtags_inc],
|
|
dependencies: [m_dep, sdl3_dep, libtags_dep, flac_dep, libmpg123_dep])
|
|
|
|
install_data(['COPYING'])
|
|
install_subdir('files', install_dir: 'share/wavy', strip_directory: true)
|