From 5cfb96a96732310eb4d38c7ae65acf717c1a4477 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 16 Dec 2021 05:24:31 +0100 Subject: [PATCH] Add wintoastlib for windows --- meson.build | 5 +-- subprojects/packagefiles/wintoast/meson.build | 33 +++++++++++++++++++ subprojects/wintoast.wrap | 5 +++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 subprojects/packagefiles/wintoast/meson.build create mode 100644 subprojects/wintoast.wrap diff --git a/meson.build b/meson.build index fb762c63..9e867f6a 100644 --- a/meson.build +++ b/meson.build @@ -310,7 +310,7 @@ sources = [ 'src/main.cpp', 'third_party/blurhash/blurhash.cpp', - ] +] if host_machine.system() == 'darwin' add_languages('objcpp') @@ -319,8 +319,9 @@ if host_machine.system() == 'darwin' deps += dependency('Cocoa', method: 'extraframework') deps += dependency('UserNotifications', method: 'extraframework') elif host_machine.system() == 'windows' - sources += ['src/notifications/ManagerWin.cpp', 'src/wintoastlib.cpp'] + sources += ['src/notifications/ManagerWin.cpp'] add_project_arguments('-D_WIN32_WINNT=0x0601', '-DNOMINMAX WIN32_LEAN_AND_MEAN', '-DSTRICT', '/Zc:__cplusplus', language: 'cpp') + deps += dependency('wintoastlib') else sources += ['src/notifications/ManagerLinux.cpp'] endif diff --git a/subprojects/packagefiles/wintoast/meson.build b/subprojects/packagefiles/wintoast/meson.build new file mode 100644 index 00000000..1d4986f4 --- /dev/null +++ b/subprojects/packagefiles/wintoast/meson.build @@ -0,0 +1,33 @@ +project( + 'wintoast', 'cpp', + version: '0.2.0', + default_options: [ + 'warning_level=2' + ], + meson_version: '>= 0.54.0' +) + +install_headers( + 'src/wintoastlib.h', +) + +inc = include_directories('src') +wintoastlib = library( + 'wintoast', + 'wintoastlib.cpp', + include_directories: inc, +) + +wintoast_dep = declare_dependency( + link_with: wintoastlib, + include_directories: inc, +) +meson.override_dependency('wintoast', wintoast_dep) + +# Generate pc file +pkg = import('pkgconfig') + +pkg.generate(wintoastlib, + name: 'wintoast', + description: 'WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8 & Windows 10.') + diff --git a/subprojects/wintoast.wrap b/subprojects/wintoast.wrap new file mode 100644 index 00000000..a0d2f7d1 --- /dev/null +++ b/subprojects/wintoast.wrap @@ -0,0 +1,5 @@ +[wrap-git] +url = https://github.com/mohabouje/WinToast.git +revision = 5e441fd03543b999edb663caf8df7be37c0d575c + +patch_directory = wintoast