Skip to content

Commit

Permalink
added cmake system and fix compatibility quirks
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Oct 6, 2021
1 parent 02143a9 commit 21c2ae4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ notifications.md
.ccls-cache
.DS_Store
.ccls
.cache/
CMakeLists.txt
.cache
.cmake
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
6 changes: 4 additions & 2 deletions src/alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 21c2ae4

Please sign in to comment.