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.
This commit is contained in:
Luflosi 2020-10-19 12:10:11 +02:00
parent 92a705c79e
commit 46ef2f313b
No known key found for this signature in database
GPG Key ID: 4E41E29EDCC345D0

View File

@ -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 <UserNotifications/UserNotifications.h>
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: