mirror of
https://github.com/FelixKratz/SketchyBar
synced 2025-02-28 13:07:11 +00:00
added cmake system and fix compatibility quirks
This commit is contained in:
parent
02143a9613
commit
21c2ae42cf
4 changed files with 20 additions and 5 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -4,8 +4,8 @@ notifications.md
|
|||
.ccls-cache
|
||||
.DS_Store
|
||||
.ccls
|
||||
.cache/
|
||||
CMakeLists.txt
|
||||
.cache
|
||||
.cmake
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
cmake_install.cmake
|
||||
|
|
13
CMakeLists.txt
Normal file
13
CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
cmake_minimum_required(VERSION 3.21)
|
||||
project(sketchybar)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_SOURCE_DIR src)
|
||||
set(CMAKE_C_FLAGS "-std=c99 -Wall -DNDEBUG -Ofast -fvisibility=hidden -mmacosx-version-min=10.13")
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
|
||||
find_library(CARBON Carbon)
|
||||
find_library(COCOA Cocoa)
|
||||
find_library(SKYLIGHT SkyLight /System/Library/PrivateFrameworks)
|
||||
add_executable(sketchybar ${CMAKE_SOURCE_DIR}/manifest.m)
|
||||
target_include_directories (sketchybar PUBLIC ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/misc)
|
||||
target_link_libraries(sketchybar ${CARBON} ${COCOA} ${SKYLIGHT})
|
|
@ -45,8 +45,10 @@ void print_all_menu_items(FILE* rsp) {
|
|||
CFRelease(window_list);
|
||||
}
|
||||
|
||||
void alias_get_permission(struct alias* alias) {
|
||||
if (@available(macOS 10.15, *)) alias->permission = CGRequestScreenCaptureAccess();
|
||||
void alias_get_permission(struct alias* alias) {
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
||||
if (__builtin_available(macOS 11.0, *)) alias->permission = CGRequestScreenCaptureAccess();
|
||||
#endif
|
||||
}
|
||||
|
||||
void alias_init(struct alias* alias, char* owner, char* name) {
|
||||
|
|
|
@ -673,7 +673,7 @@ static void handle_domain_batch(FILE* rsp, struct token domain, char* message) {
|
|||
command = get_token(&message);
|
||||
}
|
||||
bar_manager_unfreeze(&g_bar_manager);
|
||||
bar_manager_refresh(&g_bar_manager, false);
|
||||
bar_manager_refresh(&g_bar_manager, true);
|
||||
}
|
||||
|
||||
static void handle_domain_group(FILE* rsp, struct token domain, char* message) {
|
||||
|
|
Loading…
Add table
Reference in a new issue