gBar/meson.build

110 lines
2.8 KiB
Meson
Raw Normal View History

2023-01-13 15:13:56 +00:00
project('gBar',
['c', 'cpp'],
2023-01-13 15:13:56 +00:00
version: '0.0.1',
license: 'MIT',
2023-02-10 16:30:02 +00:00
meson_version: '>=0.49.0',
default_options: ['cpp_std=c++17',
'warning_level=3',
'default_library=static',
'buildtype=release'],
)
2023-01-13 15:13:56 +00:00
# Wayland protocols
wayland_client = dependency('wayland-client')
wayland_scanner = find_program('wayland-scanner')
ext_workspace_src = custom_target('generate-ext-workspace-src',
input: ['protocols/ext-workspace-unstable-v1.xml'],
output: ['ext-workspace-unstable-v1.c'],
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'])
ext_workspace_header = custom_target('generate-ext-workspace-header',
input: ['protocols/ext-workspace-unstable-v1.xml'],
output: ['ext-workspace-unstable-v1.h'],
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
2023-01-13 15:13:56 +00:00
gtk = dependency('gtk+-3.0')
gtk_layer_shell = dependency('gtk-layer-shell-0')
headers = [
'src/Common.h',
'src/Log.h',
'src/System.h',
'src/PulseAudio.h',
'src/Widget.h',
'src/Window.h',
'src/Config.h',
'src/CSS.h'
]
if get_option('WithHyprland')
add_global_arguments('-DWITH_WORKSPACES', language: 'cpp')
headers += 'src/Workspaces.h'
endif
if get_option('WithWorkspaces')
add_global_arguments('-DWITH_WORKSPACES', language: 'cpp')
headers += 'src/Workspaces.h'
2023-01-13 15:13:56 +00:00
endif
if get_option('WithNvidia')
add_global_arguments('-DWITH_NVIDIA', language: 'cpp')
headers += 'src/NvidiaGPU.h'
2023-01-13 15:13:56 +00:00
endif
if get_option('WithAMD')
add_global_arguments('-DWITH_AMD', language: 'cpp')
headers += 'src/AMDGPU.h'
endif
if get_option('WithBlueZ')
add_global_arguments('-DWITH_BLUEZ', language: 'cpp')
2023-01-13 15:13:56 +00:00
endif
if get_option('WithSys')
add_global_arguments('-DWITH_SYS', language: 'cpp')
2023-01-13 15:13:56 +00:00
endif
if get_option('ForceHyprlandIPC')
add_global_arguments('-DFORCE_HYPRLAND_IPC', language: 'cpp')
endif
2023-01-13 15:13:56 +00:00
add_global_arguments('-DUSE_LOGFILE', language: 'cpp')
2023-01-13 15:13:56 +00:00
pulse = dependency('libpulse')
libgBar = library('gBar',
[ ext_workspace_src,
ext_workspace_header,
'src/Window.cpp',
'src/Widget.cpp',
'src/System.cpp',
'src/Bar.cpp',
'src/Workspaces.cpp',
'src/AudioFlyin.cpp',
'src/BluetoothDevices.cpp',
2023-01-29 15:47:50 +00:00
'src/Plugin.cpp',
'src/Config.cpp',
'src/CSS.cpp',
'src/Log.cpp',
],
dependencies: [gtk, gtk_layer_shell, pulse, wayland_client],
install: true)
pkg = import('pkgconfig')
pkg.generate(libgBar)
executable(
'gBar',
['src/gBar.cpp'],
dependencies: [gtk],
link_with: libgBar,
2023-02-21 09:05:13 +00:00
install_rpath: '$ORIGIN/',
2023-01-13 15:13:56 +00:00
install: true
)
install_headers(
headers,
subdir: 'gBar'
)
2023-01-28 16:29:10 +00:00
install_data(
['css/style.css',
'css/style.scss'],
install_dir: get_option('datadir') / 'gBar'
)