From 46ef2f313bbbc576715dbe0e4f2fd8e59fe89a6d Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 19 Oct 2020 12:10:11 +0200 Subject: [PATCH] macOS: Fix detection for notification API For some reason it can happen that the `UserNotifications` framework exists but the `UserNotifications/UserNotifications.h` header doesn't. Closes https://github.com/kovidgoyal/kitty/issues/3042. --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a0a2613f0..a78849695 100755 --- a/setup.py +++ b/setup.py @@ -343,7 +343,10 @@ def kitty_env() -> Env: platform_libs = [ '-framework', 'CoreText', '-framework', 'CoreGraphics', ] - user_notifications_framework = first_successful_compile(ans.cc, '-framework UserNotifications') + test_program_src = '''#include + int main(void) { return 0; }\n''' + user_notifications_framework = first_successful_compile(ans.cc, ' -framework UserNotifications', + src=test_program_src, lang='objective-c') if user_notifications_framework: platform_libs.extend(shlex.split(user_notifications_framework)) else: