draconisplusplus/meson.build

114 lines
2.6 KiB
Meson
Raw Normal View History

project(
2024-06-06 04:14:52 -04:00
'draconis++', 'cpp',
2024-06-22 01:55:17 -04:00
version: '0.1.0',
default_options: [
'cpp_std=c++23',
'default_library=static',
2024-06-02 06:03:21 -04:00
'warning_level=everything',
2024-06-08 22:28:26 -04:00
'buildtype=debugoptimized'
]
)
2024-06-22 01:55:17 -04:00
clangtidy = find_program('clang-tidy', required: false)
2024-06-02 06:03:21 -04:00
cpp = meson.get_compiler('cpp')
2024-06-05 19:04:53 -04:00
2024-06-22 01:55:17 -04:00
if host_machine.system() == 'darwin'
add_languages('objcpp')
objcpp = meson.get_compiler('objcpp')
add_project_arguments(
objcpp.get_supported_arguments([
2024-06-06 04:14:52 -04:00
'-Wno-c++20-compat',
2024-06-18 04:10:36 -04:00
'-Wno-c++20-extensions',
2024-06-06 04:14:52 -04:00
'-Wno-c++98-compat',
'-Wno-c++98-compat-pedantic',
2024-06-07 04:23:11 -04:00
'-Wno-disabled-macro-expansion',
2024-06-06 04:14:52 -04:00
'-Wno-missing-prototypes',
'-Wno-padded',
'-Wno-pre-c++20-compat-pedantic',
'-Wno-switch-default',
'-Wunused-function',
2024-06-22 01:55:17 -04:00
]),
language: 'objcpp'
)
endif
common_cpp_args = [
'-Wno-c++20-compat',
'-Wno-c++20-extensions',
'-Wno-c++98-compat',
'-Wno-c++98-compat-pedantic',
'-Wno-disabled-macro-expansion',
'-Wno-missing-prototypes',
'-Wno-padded',
'-Wno-pre-c++20-compat-pedantic',
'-Wno-switch-default',
'-Wunused-function'
]
if host_machine.system() == 'windows'
common_cpp_args += ['-DCURL_STATICLIB']
endif
add_project_arguments(
cpp.get_supported_arguments(common_cpp_args),
language: 'cpp'
)
2024-06-01 06:59:01 -04:00
source_file_names = [
'src/main.cpp',
'src/config/config.cpp',
2024-06-22 01:55:17 -04:00
'src/config/weather.cpp'
2024-06-01 06:59:01 -04:00
]
2024-06-22 01:55:17 -04:00
if host_machine.system() == 'linux'
source_file_names += ['src/os/linux.cpp']
elif host_machine.system() == 'darwin'
source_file_names += [
'src/os/macos.cpp',
'src/os/macos/bridge.mm',
]
elif host_machine.system() == 'windows'
source_file_names += ['src/os/windows.cpp']
endif
sources = []
2024-06-22 01:55:17 -04:00
foreach file : source_file_names
sources += files(file)
endforeach
2024-06-22 01:55:17 -04:00
deps = [
dependency('fmt', static: host_machine.system() != 'darwin'),
dependency('libcurl', static: host_machine.system() != 'darwin'),
dependency('tomlplusplus', static: host_machine.system() != 'darwin'),
dependency('yyjson', static: host_machine.system() != 'darwin')
]
2024-06-05 19:04:53 -04:00
2024-06-22 01:55:17 -04:00
if host_machine.system() == 'darwin'
deps += dependency('Foundation')
deps += dependency('MediaPlayer')
elif host_machine.system() == 'linux'
deps += dependency('sdbus-c++')
endif
2024-06-06 04:14:52 -04:00
2024-06-22 01:55:17 -04:00
objc_args = []
link_args = []
if host_machine.system() == 'darwin'
objc_args += ['-fobjc-arc']
link_args += ['-framework', 'Foundation', '-framework', 'MediaPlayer']
elif host_machine.system() == 'windows'
windows_sdk_lib_dir = 'C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64'
link_args += ['-L' + windows_sdk_lib_dir, '-lwindowsapp', '-static']
endif
2024-06-06 04:14:52 -04:00
executable(
'draconis++',
sources,
2024-06-22 01:55:17 -04:00
objc_args: objc_args,
link_args: link_args,
dependencies: deps
)