# =========================================================================== # BastionGuard™ Secure Connection — Root meson.build # Copyright (C) 2025–2026 Calogero Scarnà # GPL-3.0 — BastionGuard™ is a trademark of Calogero Scarnà. # =========================================================================== project('bastionguard-secure-connection', 'cpp', version : '2.0', default_options : ['cpp_std=c++23']) conf = configuration_data() conf.set_quoted('BG_SECURE_CONNECTION_VERSION', meson.project_version()) configure_file( output : 'config.h', configuration : conf ) # ── Percorsi ───────────────────────────────────────────────────────────────── src_root = meson.project_source_root() build_root = meson.project_build_root() daemon_dir = join_paths(src_root, 'daemon') ui_dir = join_paths(src_root, 'ui') daemon_data_dir = join_paths(daemon_dir, 'data') daemon_install_dir = join_paths(get_option('sysconfdir'), 'bastionguard-secure-connectiond') # ── i18n / gettext ─────────────────────────────────────────────────────────── localedir = join_paths(get_option('prefix'), get_option('localedir')) add_project_arguments( '-DLOCALEDIR="' + localedir + '"', language : 'cpp' ) # ── Include del protocollo condiviso daemon ↔ UI (header-only) ────────────── # Il protocollo di wire e' definito in common/include/bsc/proto/Wire.hpp # (framing length-prefixed + schema JSON). Nessun code-gen richiesto. common_include_dir = include_directories('common/include') # Include directory root: serve alle subdir per trovare config.h generato # dal configure_file() qui sopra nella build dir root. root_include_dir = include_directories('.') # ── Step 1: build daemon C++ ───────────────────────────────────────────────── subdir('daemon') # ── Step 2: build UI C++/gtkmm4 ────────────────────────────────────────────── subdir('ui') # ── Target helper: run-dev ─────────────────────────────────────────────────── run_target('run-dev', command: [ 'sh', '-c', 'BSC_DATA=' + join_paths(ui_dir, 'data') + ' ' + join_paths(build_root, 'ui', 'bastionguard-sc-ui'), ], ) # ── Installazione file daemon ──────────────────────────────────────────────── install_data( [ join_paths(daemon_data_dir, 'default-config.json'), join_paths(daemon_data_dir, 'network_aliases.json'), join_paths(daemon_data_dir, 'system-fw.json'), ], install_dir : daemon_install_dir, ) install_subdir( 'daemon/data/rules', install_dir : daemon_install_dir, ) install_subdir( 'daemon/data/tasks', install_dir : daemon_install_dir, ) # ── Installazione file di sistema ──────────────────────────────────────────── # The integrated BastionGuard build disables this and installs the selected # systemd/OpenRC/SysVinit/Dinit service through its central init-system layer. if get_option('install_systemd_service') install_data( 'dist/bsc-daemon.service', install_dir : join_paths(get_option('prefix'), 'lib/systemd/system'), ) endif install_data( 'dist/eu.bastionguard.sc.policy', install_dir : join_paths(get_option('prefix'), 'share/polkit-1/actions'), ) # ── Installazione file .mo (traduzioni gettext) ────────────────────────────── i18n = import('i18n') subdir('po')