2024-09-05 00:13:30 -04:00
|
|
|
project(
|
2025-01-30 00:29:07 -05:00
|
|
|
'draconis++',
|
|
|
|
'cpp',
|
2024-09-05 00:13:30 -04:00
|
|
|
version: '0.1.0',
|
|
|
|
default_options: [
|
|
|
|
'default_library=static',
|
|
|
|
'warning_level=everything',
|
2025-01-30 00:29:07 -05:00
|
|
|
'buildtype=debugoptimized',
|
|
|
|
],
|
2024-09-05 00:13:30 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
cpp = meson.get_compiler('cpp')
|
|
|
|
|
|
|
|
if host_machine.system() == 'darwin'
|
|
|
|
add_languages('objcpp')
|
|
|
|
objcpp = meson.get_compiler('objcpp')
|
|
|
|
add_project_arguments(
|
2025-01-30 00:29:07 -05:00
|
|
|
objcpp.get_supported_arguments(
|
|
|
|
[
|
|
|
|
'-std=c++2b',
|
|
|
|
'-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',
|
|
|
|
'-fvisibility=hidden',
|
|
|
|
],
|
|
|
|
),
|
|
|
|
language: 'objcpp',
|
2024-09-05 00:13:30 -04:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
common_cpp_args = [
|
2025-01-29 17:08:40 -05:00
|
|
|
'-std=c++26',
|
2024-09-05 00:13:30 -04:00
|
|
|
'-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',
|
2025-01-30 00:29:07 -05:00
|
|
|
'-fvisibility=hidden',
|
2025-02-18 13:28:51 -05:00
|
|
|
'-fno-strict-enums',
|
2024-09-05 00:13:30 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
common_cpp_args += ['-DCURL_STATICLIB']
|
|
|
|
endif
|
|
|
|
|
2025-01-30 00:29:07 -05:00
|
|
|
add_project_arguments(cpp.get_supported_arguments(common_cpp_args), language: 'cpp')
|
2024-09-05 00:13:30 -04:00
|
|
|
|
2025-01-30 00:29:07 -05:00
|
|
|
source_file_names = ['src/main.cpp', 'src/config/config.cpp', 'src/config/weather.cpp']
|
2024-09-05 00:13:30 -04:00
|
|
|
|
|
|
|
if host_machine.system() == 'linux'
|
|
|
|
source_file_names += ['src/os/linux.cpp']
|
|
|
|
elif host_machine.system() == 'freebsd'
|
|
|
|
source_file_names += ['src/os/freebsd.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 = []
|
|
|
|
|
|
|
|
foreach file : source_file_names
|
|
|
|
sources += files(file)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
deps = [
|
2025-02-19 18:31:40 -05:00
|
|
|
dependency('fmt', include_type: 'system', static: true),
|
|
|
|
dependency('libcurl', include_type: 'system', static: true),
|
|
|
|
dependency('yyjson', include_type: 'system', static: true),
|
|
|
|
dependency(
|
|
|
|
'ftxui',
|
|
|
|
modules: ['ftxui::screen', 'ftxui::dom', 'ftxui::component'],
|
|
|
|
include_type: 'system',
|
|
|
|
static: true,
|
|
|
|
),
|
|
|
|
dependency('reflectcpp', include_type: 'system', static: true),
|
2024-09-05 00:13:30 -04:00
|
|
|
]
|
|
|
|
|
2025-02-19 18:31:40 -05:00
|
|
|
if host_machine.system() == 'windows'
|
|
|
|
deps += cpp.find_library('tomlplusplus', static: true, dirs: 'C:/msys64/usr/lib')
|
|
|
|
else
|
|
|
|
deps += dependency('tomlplusplus', static: true)
|
|
|
|
endif
|
|
|
|
|
2024-09-05 00:13:30 -04:00
|
|
|
if host_machine.system() == 'darwin'
|
|
|
|
deps += dependency('Foundation')
|
|
|
|
deps += dependency('MediaPlayer')
|
|
|
|
deps += dependency('SystemConfiguration')
|
|
|
|
deps += dependency('iconv')
|
|
|
|
elif host_machine.system() == 'linux' or host_machine.system() == 'freebsd'
|
2025-02-03 19:22:02 -05:00
|
|
|
deps += dependency('SQLiteCpp')
|
2024-09-05 00:13:30 -04:00
|
|
|
deps += dependency('sdbus-c++')
|
2025-01-30 19:06:46 -05:00
|
|
|
deps += dependency('x11')
|
|
|
|
deps += dependency('wayland-client')
|
2024-09-05 00:13:30 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
objc_args = []
|
|
|
|
link_args = []
|
|
|
|
|
|
|
|
if host_machine.system() == 'darwin'
|
|
|
|
objc_args += ['-fobjc-arc']
|
|
|
|
elif host_machine.system() == 'windows'
|
|
|
|
windows_sdk_lib_dir = 'C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22621.0/um/x64'
|
2025-02-01 15:32:28 -05:00
|
|
|
link_args += ['-L' + windows_sdk_lib_dir, '-lwindowsapp', '-ldwmapi', '-static']
|
2024-09-05 00:13:30 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
executable(
|
|
|
|
'draconis++',
|
|
|
|
sources,
|
|
|
|
objc_args: objc_args,
|
|
|
|
link_args: link_args,
|
2025-01-30 00:29:07 -05:00
|
|
|
dependencies: deps,
|
2025-02-19 18:31:40 -05:00
|
|
|
)
|