draconisplusplus/meson.build
2024-06-05 19:04:53 -04:00

101 lines
2 KiB
Meson

project(
'draconis++', ['cpp', 'objcpp'],
version: '0.1.0',
default_options: [
'objc_std=c++20',
'objcpp_std=c++20',
'cpp_std=c++20',
'default_library=static',
'warning_level=everything',
'buildtype=debugoptimized'
]
)
clangtidy = find_program('clang-tidy', required: false)
cpp = meson.get_compiler('cpp')
objcpp = meson.get_compiler('objcpp')
add_project_arguments(
objcpp.get_supported_arguments([
'-Wno-c++20-compat',
'-Wno-c++98-compat',
'-Wno-c++98-compat-pedantic',
'-Wno-missing-prototypes',
'-Wno-padded',
'-Wno-pre-c++20-compat-pedantic',
'-Wno-switch-default',
'-Wunused-function',
]),
language: 'objcpp'
)
add_project_arguments(
cpp.get_supported_arguments([
'-Wno-c++20-compat',
'-Wno-c++98-compat',
'-Wno-c++98-compat-pedantic',
'-Wno-missing-prototypes',
'-Wno-padded',
'-Wno-pre-c++20-compat-pedantic',
'-Wno-switch-default',
'-Wunused-function',
]),
language: 'cpp'
)
source_file_names = [
'src/main.cpp',
'src/os/os.h',
'src/config/config.cpp',
'src/config/config.h',
'src/config/weather.cpp'
]
if host_machine.system() == 'linux'
source_file_names += ['src/os/linux.cpp']
endif
if host_machine.system() == 'darwin'
source_file_names += [
'src/os/macos.cpp',
'src/os/macos/NowPlayingBridge.h',
'src/os/macos/NowPlayingBridge.mm'
]
endif
sources = []
foreach file : source_file_names
sources += files(file)
endforeach
deps = []
deps += cpp.find_library('cpr')
deps += cpp.find_library('curl')
deps += cpp.find_library('tomlplusplus')
deps += dependency('coost')
deps += dependency('fmt')
deps += dependency('Foundation')
deps += dependency('MediaPlayer')
if host_machine.system() == 'linux'
deps += dependency('playerctl')
endif
incdir = include_directories(
'include',
is_system: true # Ignores warnings from include dir
)
executable(
'draconis++',
sources,
dependencies: deps,
include_directories: incdir,
objc_args: ['-fobjc-arc'],
link_args: ['-framework', 'Foundation', '-framework', 'MediaPlayer']
)